|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PreferenceModel
A preference model is a list of objects which represent some preferences of another resource. A preference model has enough information to be displayed in a graphical user interface and be modified by a user.
Method Summary | |
---|---|
void |
addPreferenceModelListener(PreferenceModelListener listener)
Adds a listener to this model. |
void |
doOperation(int index,
PreferenceOperation operation)
Executes the enabled operation operation . |
String |
getDescription(int index)
Gets a description of the index 'th object. |
String |
getLabel(int index)
Gets a short label that can be presented to the user for the index 'th object. |
PreferenceOperation[] |
getOperations(int index)
Gets all operations for which this model has a definition for the preference at location index . |
Path |
getPath(int index)
Gets the unique location 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. |
boolean |
isEnabled(int index,
PreferenceOperation operation)
Tells whether the operation operation is enabled for
the preference at location index . |
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 |
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. |
Method Detail |
---|
void read()
void write()
void addPreferenceModelListener(PreferenceModelListener listener)
listener
- the new listenervoid removePreferenceModelListener(PreferenceModelListener listener)
listener
- the listener to remove.int getSize()
String getLabel(int index)
index
'th object.
index
- the number the preference
String getDescription(int index)
index
'th object. The description
is a longer text that will be presented to the user.
index
- the number of the preference
null
, might be formated
in HTMLboolean isEnabled(int index, PreferenceOperation operation)
operation
is enabled for
the preference at location index
.
index
- some locationoperation
- an operation from getOperations(int)
true
if the operation is enabled, false
if notPreferenceOperation[] getOperations(int index)
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.
index
- the location of a preference
null
void doOperation(int index, PreferenceOperation operation)
operation
.
index
- the location of the affected preferenceoperation
- the operation to executeObject getValueInfo(int index)
index
'th value can
be modified. For an integer that might be its upper and lower boundaries.
The type of this objects depends on getTypePath(int)
.
index
- the index of the info
null
if no information is
availableObject getValue(int index)
index
'th preference. The type path
determines how the value is to be presented on the screen.
index
- the number of the preference
null
, has to be immutablevoid setValue(int index, Object value)
index
'th preference.
index
- the number of the preferencevalue
- the new value, may be null
Path getTypePath(int index)
index
'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 value
Path getPath(int index)
index
'th preference of
this model.
index
- the index of the preference
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |