public interface Editor<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
Editor.GraphEditor<T> |
static interface |
Editor.TableEditor<T> |
Modifier and Type | Method and Description |
---|---|
void |
applyEdit()
Applies the changes made by the user to the underlying object to
be edited.
|
void |
close()
Tells the editor to release all resources held by it and to
unregister all listeners.
|
T |
getEditingItem()
Returns the object last set by
setEditingItem(Object) or
null if this editor has not been assigned any items yet. |
java.awt.Component |
getEditorComponent()
Returns the
Component this editor uses to
present its user interface. |
boolean |
hasChanges()
Compares the current presented state (including potential
user input) with the object last set via
setEditingItem(Object)
and returns true if and only if there is a difference between
those two. |
void |
resetEdit()
Discards all user input and reloads the appearance based on the
data last set via
setEditingItem(Object) . |
void |
setEditingItem(T item)
Resets the editor to use the supplied
item . |
java.awt.Component getEditorComponent()
Component
this editor uses to
present its user interface. This method must not return
null
values.
Note that it is not required for an editor to always return
the same Component
! Implementations using an editor are
advised to retrieve the latest component used by an editor whenever
they intend to display it.
void setEditingItem(T item)
item
. It is legal to
provide null
values in which case the editor should simply
clear its interface. If the supplied item
is not of a supported
type then the editor should throw an IllegalArgumentException
.T getEditingItem()
setEditingItem(Object)
or
null
if this editor has not been assigned any items yet.void resetEdit()
setEditingItem(Object)
. If no data is
set to be edited then the editor should present a "blank" interface.void applyEdit()
boolean hasChanges()
setEditingItem(Object)
and returns true
if and only if there is a difference between
those two. If no object has been set for being edited then this method
should return false
.void close()