|
||||||||||
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.FormEditorValueAdapter
public class FormEditorValueAdapter
A form editor that acts as a simple wrapper around any FormEditor
instance. Allows a ValueConverter to convert to/from the format
used by it's wrapped editor. Note that this type of auto
conversion can also be performed by BasicForm's BasicForm.addEditor(java.lang.String,dsto.dfc.swing.forms.FormEditor,dsto.dfc.swing.text.ValueConverter)
method.
Field Summary |
---|
Fields inherited from class dsto.dfc.swing.forms.AbstractFormEditor |
---|
converter, description |
Constructor Summary | |
---|---|
FormEditorValueAdapter(FormEditor adaptee,
ValueConverter converter)
|
Method Summary | |
---|---|
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). |
void |
editCommitRequested(ChangeEvent e)
Signals that the editor is ready to commit a value into the model. |
void |
editCommitted(ChangeEvent e)
Signals that an edit has been committed into the model. |
Component |
getEditorComponent()
Get the component, if any, that acts as a UI for this editor. |
String |
getEditorDescription()
Get a short description of the value being edited for this editor (eg 'host name'). |
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 |
setEditorValue(Object value)
Sets the value to be displayed/edited by the form editor. |
Methods inherited from class dsto.dfc.swing.forms.AbstractFormEditor |
---|
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, removeFormEditorListener |
Constructor Detail |
---|
public FormEditorValueAdapter(FormEditor adaptee, ValueConverter converter)
Method Detail |
---|
public void dispose()
Disposable
dispose
in interface Disposable
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 setEditorValue(Object value) throws IllegalFormatException
FormEditor
setEditorValue
in interface FormEditor
setEditorValue
in class AbstractFormEditor
value
- 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 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 Component getEditorComponent()
FormEditor
getEditorComponent
in interface FormEditor
getEditorComponent
in class AbstractFormEditor
public String getEditorDescription()
FormEditor
getEditorDescription
in interface FormEditor
getEditorDescription
in class AbstractFormEditor
public void editCommitted(ChangeEvent e)
FormEditorListener
editCommitted
in interface FormEditorListener
public void editCommitRequested(ChangeEvent e)
FormEditorListener
editCommitRequested
in interface FormEditorListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |