|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FormEditor
Defines an editor for a value, similar in concept to a JFC cell
editor. Editors support set/get of their current editorValue
property, as well as notification of changes to the value via
editCommitted events (see FormEditorListener
).
When the value of the editor changes, the editor should immediately
fire an editCommitted event (eg see JCheckBoxFormEditor
). If an editor wishes to initiate a controlled
commit, where an error in the new value might need to be handled,
it should fire an editCommitRequested event instead: this will
signal its parent environment to call the editor's commitEdits ()
and either handle any IllegalFormatException encountered or commit
the new value. Only editors that must handle invalid entries need
use this capability - for an example, see JTextFieldFormEditor
.
Method Summary | |
---|---|
void |
addFormEditorListener(FormEditorListener l)
|
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). |
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()
The preferred type of value for the editor. |
boolean |
isDirectEdit()
True if the editor directly edits the value passed in with setValue (). |
void |
removeFormEditorListener(FormEditorListener l)
|
void |
setEditorValue(Object value)
Sets the value to be displayed/edited by the form editor. |
Method Detail |
---|
boolean isDirectEdit()
Class getPreferredValueType()
setEditorValue(java.lang.Object)
. May
return java.lang.Object to indictate no preferred type.
void setEditorValue(Object value) throws IllegalFormatException
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.Object getEditorValue()
Component getEditorComponent()
String getEditorDescription()
void commitEdits() throws IllegalFormatException
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).void addFormEditorListener(FormEditorListener l)
void removeFormEditorListener(FormEditorListener l)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |