V
- the kind of value this editor editspublic interface PreferenceEditor<V>
Component
which is used to edit some value. How
exactly this component is configured depends on the meta-information
extracted from the preference
which is edited.callback
. The
editor can ask its parent to show some buttons which represent operations this editor can execute. For
example an editor could ask its parent to show a "reset value to default"-button. The editor manages these buttons
by calling PreferenceEditorCallback.setOperation(PreferenceOperation, boolean)
and by implementing
doOperation(PreferenceOperation)
.Modifier and Type | Method and Description |
---|---|
void |
doOperation(PreferenceOperation operation)
Executes the operation that matches
operation or does
nothing if operation is unknown. |
java.awt.Component |
getComponent()
Gets a component which displays the contents of this editor.
|
V |
getValue()
Gets the value of this editor.
Note: editors should call PreferenceEditorCallback.set(Object)
when their value got edited by the user. |
void |
setCallback(PreferenceEditorCallback<V> callback)
Sets a callback, a callback can be used to read the value that has to
be edited or to store the edited value.
Note: this editor should call PreferenceEditorCallback.set(Object)
whenever this editor shows a new valid value. |
void |
setValue(V value)
Sets the current value of this editor.
|
void |
setValueInfo(java.lang.Object information)
Sets information about the value that is shown.
|
java.awt.Component getComponent()
null
void setCallback(PreferenceEditorCallback<V> callback)
PreferenceEditorCallback.set(Object)
whenever this editor shows a new valid value.callback
- the callback, might be null
void setValueInfo(java.lang.Object information)
setValue(Object)
. This method might be called with
a null
argument when the editor is no longer needed.information
- the information, may be null
void setValue(V value)
value
- the value, might be null
V getValue()
PreferenceEditorCallback.set(Object)
when their value got edited by the user. An editor should not expect
a call to this method.null
void doOperation(PreferenceOperation operation)
operation
or does
nothing if operation
is unknown.operation
- the operation that was triggered