|
||||||||||
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.BasicForm
public class BasicForm
Basic implementation of the Form interface. Designed to be used either as a base as a delegate.
Nested Class Summary | |
---|---|
protected static class |
BasicForm.EditorEntry
|
Field Summary | |
---|---|
boolean |
directEdit
|
Constructor Summary | |
---|---|
BasicForm()
|
Method Summary | |
---|---|
void |
addEditor(String property,
FormEditor editor)
|
void |
addEditor(String property,
FormEditor editor,
ValueConverter converter)
Add an editor for a given property of the form value. |
protected void |
commitChildren()
|
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. |
protected BasicForm.EditorEntry |
findEntry(FormEditor editor)
|
Component |
getEditorComponent()
Get the component, if any, that acts as a UI for this editor. |
int |
getEditorCount()
|
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. |
static void |
handleCommitError(IllegalFormatException ex)
|
boolean |
isDeferredCommit()
True if editor commit requests from child editors are deferred until commitEdits () is explicitly called on this form. |
boolean |
isDirectEdit()
True if the editor directly edits the value passed in with setValue (). |
protected void |
loadEditor(BasicForm.EditorEntry entry)
|
protected void |
loadEditors()
|
void |
propertyChange(PropertyChangeEvent e)
|
boolean |
removeEditor(FormEditor editor)
Remove a bound form editor. |
void |
setDeferredCommit(boolean newValue)
|
void |
setDirectEdit(boolean newValue)
Set whether this editor works in direct edit (default) mode, or indirect. |
void |
setEditorValue(Object newValue)
Sets the value to be displayed/edited by the form editor. |
void |
setPreferredValueType(Class newValueType)
|
protected void |
unloadEditor(BasicForm.EditorEntry entry)
|
protected void |
unloadEditors()
|
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 |
Field Detail |
---|
public boolean directEdit
Constructor Detail |
---|
public BasicForm()
Method Detail |
---|
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDirectEdit()
FormEditor
isDirectEdit
in interface FormEditor
public void setDirectEdit(boolean newValue)
public Class getPreferredValueType()
FormEditor
FormEditor.setEditorValue(java.lang.Object)
. May
return java.lang.Object to indictate no preferred type.
getPreferredValueType
in interface FormEditor
public void setPreferredValueType(Class newValueType)
public String getEditorDescription()
FormEditor
getEditorDescription
in interface FormEditor
public boolean isDeferredCommit()
Form
isDeferredCommit
in interface Form
public void setDeferredCommit(boolean newValue)
setDeferredCommit
in interface Form
public void addEditor(String property, FormEditor editor)
addEditor
in interface Form
public void addEditor(String property, FormEditor editor, ValueConverter converter)
Form
addEditor
in interface Form
property
- The property name.editor
- The editor for the property.converter
- The value converter that will be used to convert
values into the editor's format (determined by FormEditor.getPreferredValueType()
and from the editor back to the
property value. May be null for no conversion.Form.removeEditor(dsto.dfc.swing.forms.FormEditor)
public boolean removeEditor(FormEditor editor)
Form
removeEditor
in interface Form
Form.addEditor(java.lang.String, dsto.dfc.swing.forms.FormEditor)
public int getEditorCount()
protected BasicForm.EditorEntry findEntry(FormEditor editor)
protected void loadEditors() throws IllegalFormatException
IllegalFormatException
protected void unloadEditors() throws IllegalFormatException
IllegalFormatException
protected void loadEditor(BasicForm.EditorEntry entry) throws IllegalFormatException
IllegalFormatException
protected void unloadEditor(BasicForm.EditorEntry entry) throws IllegalFormatException
IllegalFormatException
protected void commitChildren() throws IllegalFormatException
IllegalFormatException
public void commitEdits() throws IllegalFormatException
FormEditor
commitEdits
in interface FormEditor
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
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
public Component getEditorComponent()
FormEditor
getEditorComponent
in interface FormEditor
public void editCommitRequested(ChangeEvent e)
FormEditorListener
editCommitRequested
in interface FormEditorListener
public void editCommitted(ChangeEvent e)
FormEditorListener
editCommitted
in interface FormEditorListener
public static void handleCommitError(IllegalFormatException ex)
public void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |