|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dsto.dfc.swing.forms.BasicFormEditorEventSource dsto.dfc.swing.forms.AbstractFormEditor dsto.dfc.swing.forms.JComboBoxFormEditor
public class JComboBoxFormEditor
A form editor that can be used to bind JComboBox'es.
Field Summary |
---|
Fields inherited from class dsto.dfc.swing.forms.AbstractFormEditor |
---|
converter, description |
Constructor Summary | |
---|---|
JComboBoxFormEditor()
|
|
JComboBoxFormEditor(JComboBox comboBox)
|
|
JComboBoxFormEditor(JComboBox comboBox,
String description)
|
|
JComboBoxFormEditor(JComboBox comboBox,
ValueConverter converter,
String description)
|
|
JComboBoxFormEditor(JComboBox comboBox,
ValueConverter converter,
String description,
Class comboItemType)
Creates a new JComboBoxFormEditor instance. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
void |
commitEdits()
Commit any changes not already committed into the value of this editor (eg a text editor will attempt to perform any uncommitted text conversions at this point). |
void |
dispose()
Dispose of the object (unregister listeners, close open resources etc). |
JComboBox |
getComboBox()
|
Component |
getEditorComponent()
Get the component, if any, that acts as a UI for this editor. |
Object |
getEditorValue()
Get the current value from the form editor. |
Class |
getPreferredValueType()
Default implementation: returns java.lang.Object to indicate no preferred type. |
boolean |
isDirectEdit()
True if the editor directly edits the value passed in with setValue (). |
void |
setComboBox(JComboBox newValue)
|
void |
setComboItemType(Class newValue)
Set the type of item in the combo box. |
void |
setEditorValue(Object newValue)
Sets the value to be displayed/edited by the form editor. |
void |
setPreferredValueType(Class newValueType)
|
Methods inherited from class dsto.dfc.swing.forms.AbstractFormEditor |
---|
getEditorDescription, setEditorDescription |
Methods inherited from class dsto.dfc.swing.forms.BasicFormEditorEventSource |
---|
addFormEditorListener, clone, fireEditComitted, fireEditCommitRequested, fireEditCommitted, removeFormEditorListener, setFormEditorEventSource |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface dsto.dfc.swing.forms.FormEditor |
---|
addFormEditorListener, getEditorDescription, removeFormEditorListener |
Constructor Detail |
---|
public JComboBoxFormEditor()
public JComboBoxFormEditor(JComboBox comboBox)
public JComboBoxFormEditor(JComboBox comboBox, String description)
public JComboBoxFormEditor(JComboBox comboBox, ValueConverter converter, String description)
public JComboBoxFormEditor(JComboBox comboBox, ValueConverter converter, String description, Class comboItemType)
JComboBoxFormEditor
instance.
comboBox
- The combo box to bind to.converter
- The value converter to use (may be null).description
- The description of the value being edited (eg
"first name")comboItemType
- The type of items in the combo box's model.
Used to determine what type to tell the converter to convert to
on loading. May be null for no conversion.Method Detail |
---|
public void setComboItemType(Class newValue)
public void dispose()
Disposable
dispose
in interface Disposable
public void setComboBox(JComboBox newValue)
public JComboBox getComboBox()
public boolean isDirectEdit()
FormEditor
isDirectEdit
in interface FormEditor
isDirectEdit
in class AbstractFormEditor
public Class getPreferredValueType()
AbstractFormEditor
getPreferredValueType
in interface FormEditor
getPreferredValueType
in class AbstractFormEditor
public void setPreferredValueType(Class newValueType)
public void commitEdits() throws IllegalFormatException
FormEditor
commitEdits
in interface FormEditor
commitEdits
in class AbstractFormEditor
IllegalFormatException
- if the commit failed because of
an illegal input or other error. The source specified by the
exception should be the FormEditor instance that caused the error
(ie either this editor or a child).public void setEditorValue(Object newValue) throws IllegalFormatException
FormEditor
setEditorValue
in interface FormEditor
setEditorValue
in class AbstractFormEditor
newValue
- The value to display.
IllegalFormatException
- if the value was not in the
correct format for display by this editor. The source specified
by the exception should be this FormEditor instance or a child.public Object getEditorValue()
FormEditor
getEditorValue
in interface FormEditor
getEditorValue
in class AbstractFormEditor
public Component getEditorComponent()
FormEditor
getEditorComponent
in interface FormEditor
getEditorComponent
in class AbstractFormEditor
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |