|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.extension.gui.dock.preference.AbstractPreferenceModel
public abstract class AbstractPreferenceModel
An abstract implementation of PreferenceModel
handling events and
returning null
in most methods.
Constructor Summary | |
---|---|
AbstractPreferenceModel(DockController controller)
|
Method Summary | |
---|---|
void |
addPreferenceModelListener(PreferenceModelListener listener)
Adds a listener to this model. |
void |
doOperation(int index,
PreferenceOperation operation)
Executes the enabled operation operation . |
protected void |
firePreferenceAdded(int beginIndex,
int endIndex)
Informs all listeners that some preferences were added. |
protected void |
firePreferenceChanged(int beginIndex,
int endIndex)
Informs all listeners that some preferences were changed. |
protected void |
firePreferenceRemoved(int beginIndex,
int endIndex)
Informs all listeners that some preferences were removed. |
DockController |
getController()
Gets the DockController in whose realm this model is used. |
java.lang.String |
getDescription(int index)
Gets a description of the index 'th object. |
PreferenceOperation[] |
getOperations(int index)
Gets all operations for which this model has a definition for the preference at location index . |
protected boolean |
hasListeners()
Tells whether this model has listeners attached or not. |
boolean |
isEnabled(int index,
PreferenceOperation operation)
Tells whether the operation operation is enabled for
the preference at location index . |
boolean |
isNatural(int index)
Tells whether the index 'th preference is natural or
artificial. |
protected PreferenceModelListener[] |
listeners()
Gets a list of all listeners registered at this model. |
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 |
setValueNatural(int index)
Like PreferenceModel.setValue(int, Object) this method changes the value of the index 'th
preference. |
void |
write()
Writes the current preferences to the location where they are used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.extension.gui.dock.preference.PreferenceModel |
---|
getLabel, getPath, getSize, getTypePath, getValue, getValueInfo, setValue |
Constructor Detail |
---|
public AbstractPreferenceModel(DockController controller)
Method Detail |
---|
public DockController getController()
PreferenceModel
DockController
in whose realm this model is used. The controller
is mainly necessary to load icons and text.
getController
in interface PreferenceModel
public void read()
PreferenceModel
read
in interface PreferenceModel
public void write()
PreferenceModel
write
in interface PreferenceModel
public boolean isEnabled(int index, PreferenceOperation operation)
PreferenceModel
operation
is enabled for
the preference at location index
.
isEnabled
in interface PreferenceModel
index
- some locationoperation
- an operation from PreferenceModel.getOperations(int)
true
if the operation is enabled, false
if notpublic PreferenceOperation[] getOperations(int index)
PreferenceModel
index
. Note: a PreferenceEditor
has operations as well, if the editor and the model share an operation,
then the operation is considered to belong to the editor.
getOperations
in interface PreferenceModel
index
- the location of a preference
null
public void doOperation(int index, PreferenceOperation operation)
PreferenceModel
operation
.
doOperation
in interface PreferenceModel
index
- the location of the affected preferenceoperation
- the operation to executepublic void addPreferenceModelListener(PreferenceModelListener listener)
PreferenceModel
addPreferenceModelListener
in interface PreferenceModel
listener
- the new listenerpublic void removePreferenceModelListener(PreferenceModelListener listener)
PreferenceModel
removePreferenceModelListener
in interface PreferenceModel
listener
- the listener to remove.protected PreferenceModelListener[] listeners()
protected boolean hasListeners()
true
if there are listenersprotected void firePreferenceAdded(int beginIndex, int endIndex)
beginIndex
- the index of the first new preferenceendIndex
- the index of the last new preferenceprotected void firePreferenceRemoved(int beginIndex, int endIndex)
beginIndex
- the index of the first removed preferenceendIndex
- the index of the last removed preferenceprotected void firePreferenceChanged(int beginIndex, int endIndex)
beginIndex
- the index of the first changed preferenceendIndex
- the index of the last changed preferencepublic java.lang.String getDescription(int index)
PreferenceModel
index
'th object. The description
is a longer text that will be presented to the user.
getDescription
in interface PreferenceModel
index
- the number of the preference
null
, might be formated
in HTMLpublic boolean isNatural(int index)
PreferenceModel
index
'th preference is natural or
artificial.
isNatural
in interface PreferenceModel
index
- the index of the preference
true
if the preference is natural, false
if it is artificialpublic void setValueNatural(int index)
PreferenceModel
PreferenceModel.setValue(int, Object)
this method changes the value of the index
'th
preference. But this time the natural preference has to extract the value from
its underlying property.
setValueNatural
in interface PreferenceModel
index
- the index of the preference to update
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |