public class ButtonContentPreferenceModel extends AbstractPreferenceModel
PreferenceModel allows the user to set up a ButtonContent using the static
conditions that are defined in ButtonContent.| Constructor and Description |
|---|
ButtonContentPreferenceModel(DockController controller)
Creates a new model
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPreferenceModelListener(PreferenceModelListener listener)
Adds a listener to this model.
|
ButtonContent |
getContent()
Gets the currently selected
ButtonContent. |
String |
getLabel(int index)
Gets a short label that can be presented to the user for the
index'th object. |
Path |
getPath(int index)
Gets the unique identifier of the
index'th preference of
this model. |
int |
getSize()
Gets the number of preferences stored in this model.
|
Path |
getTypePath(int index)
Tells what kind of type the
index'th value is. |
Object |
getValue(int index)
Gets the
index'th preference. |
Object |
getValueInfo(int index)
Gets information about how the
index'th value can
be modified. |
void |
read()
Uses an unknown source to update this model and load all the preferences
that are currently available.
|
void |
removePreferenceModelListener(PreferenceModelListener listener)
Removes a listener from this model.
|
void |
setContent(ButtonContent content)
Sets the property that should be shown.
|
void |
setValue(int index,
Object value)
Sets the value of the
index'th preference. |
void |
write()
Writes the current preferences to the location where they are used.
|
doOperation, firePreferenceAdded, firePreferenceChanged, firePreferenceRemoved, getController, getDescription, getOperations, hasListeners, isEnabled, isNatural, listeners, setValueNaturalpublic ButtonContentPreferenceModel(DockController controller)
controller - the controller in whose realm this model workspublic void addPreferenceModelListener(PreferenceModelListener listener)
PreferenceModeladdPreferenceModelListener in interface PreferenceModeladdPreferenceModelListener in class AbstractPreferenceModellistener - the new listenerpublic void removePreferenceModelListener(PreferenceModelListener listener)
PreferenceModelremovePreferenceModelListener in interface PreferenceModelremovePreferenceModelListener in class AbstractPreferenceModellistener - the listener to remove.public void write()
PreferenceModelwrite in interface PreferenceModelwrite in class AbstractPreferenceModelpublic void read()
PreferenceModelread in interface PreferenceModelread in class AbstractPreferenceModelpublic ButtonContent getContent()
ButtonContent.nullpublic void setContent(ButtonContent content)
content - the property, can be nullpublic String getLabel(int index)
PreferenceModelindex'th object.index - the number the preferencepublic Path getPath(int index)
PreferenceModelindex'th preference of
this model.index - the index of the preferencepublic int getSize()
PreferenceModelpublic Path getTypePath(int index)
PreferenceModelindex'th value is. The type
is represented as a path. Most times the path would equal the name of
some class. Note: there is a set of standard paths defined in Path.index - the number of the valuepublic Object getValue(int index)
PreferenceModelindex'th preference. The type path
determines how the value is to be presented on the screen.index - the number of the preferencenull, has to be immutablepublic Object getValueInfo(int index)
PreferenceModelindex'th value can
be modified. For an integer that might be its upper and lower boundaries.
The type of this objects depends on PreferenceModel.getTypePath(int).index - the index of the infonull if no information is
availablepublic void setValue(int index,
Object value)
PreferenceModelindex'th preference.index - the number of the preferencevalue - the new value, may be nullCopyright © 2017 Docking Frames. All rights reserved.