bibliothek.extension.gui.dock.preference
Interface PreferenceEditorCallback<V>

Type Parameters:
V - the kind of object this callback has access to

public interface PreferenceEditorCallback<V>

A callback creates a link between a PreferenceEditor and its parent or the model. Each callback handles one preference and one editor. The editor can ask its callback to read or write a value from/to the model, or to show some buttons like "reset value to default".

Author:
Benjamin Sigg

Method Summary
 V get()
          Gets the value to which this callback has access to.
 PreferenceModel getModel()
          Gets the model from which this callback takes its values.
 void set(V value)
          Sets the value of this callback.
 void setOperation(PreferenceOperation operation, boolean enabled)
          Tells this callback that the editor knows how to perform operation.
 

Method Detail

get

V get()
Gets the value to which this callback has access to.

Returns:
the value, might be null

set

void set(V value)
Sets the value of this callback. An editor should call this method whenever its value changes.

Parameters:
value - the value, might be null

setOperation

void setOperation(PreferenceOperation operation,
                  boolean enabled)
Tells this callback that the editor knows how to perform operation. This method can be called anytime to inform this callback whether the editor is currently ready to execute operation.

Parameters:
operation - the key of the action
enabled - whether the operation is available right now

getModel

PreferenceModel getModel()
Gets the model from which this callback takes its values. The model should only be used to ask for more information, not for write access.

Returns:
the model, not null