All Packages Class Hierarchy This Package Previous Next Index
Class semper.preferences.PrefField
java.lang.Object
|
+----semper.preferences.PrefField
- public abstract class PrefField
- extends Object
- implements Serializable
All possible fields are a subclass of that one. This abstract data class
defined a set of operations any preferences field should support. This class
manages the description associated with each field and the notification schedule
which is the set of classes that receive a notification of changes for the value
of a field by the user. To invoke the description of a field, just move the mouse
over the field (not in general over the reacting area like textfield or list though)
and double-cliked. Since this class is abstract, no constructor
is given.
Remember that if you want to extend this class for a new field type, you should
always put your graphical components in a PrefPanel.
- Version:
- $Revision: 1.17 $ $Date: 1997/09/26 16:29:26 $
- Author:
- Louis Salvail (CWI)
- See Also:
- PrefFieldString, PrefFieldLabel, PrefFieldChoice, PrefFieldNegotiable, PrefFieldCheckBox, PrefFieldList
-
csts
-
the GridBagConstraints for that component
-
defCsts
-
-
noDescription
-
Default no decription label.
-
PrefField()
-
-
applyModification()
-
Applies the modification by loading the new value in the current value.
-
cancel()
-
the appearance of that field returns to it's initial value.
-
getDescription()
-
Gets the description.
-
getName()
-
This method returns the name of that field.
-
getValue()
-
Return the actual value for that field.
-
isModified()
-
Indicates if the field has been changed by the user during
interactive editing.
-
isOK()
-
Returns whether the value selected by the user is valid.
-
listNotify()
-
This returns the list of classes that will be notified
when the user changes this field.
-
newName(String)
-
Select a new name.
-
notifyChange(String)
-
Notify the registered classes.
-
registerForNotify(String)
-
This method register objects which will be notified when this field
value will be changed by the user.
-
removeFromNotify(String)
-
This method removes a registered notify class.
-
setDescription(String)
-
Set the description.
-
setValue(Object)
-
Allows to set the value for that field.
-
showme(PrefFrame)
-
Shows this field component in a frame.
defCsts
public static GridBagConstraints defCsts
csts
public GridBagConstraints csts
- the GridBagConstraints for that component
noDescription
protected static final String noDescription
- Default no decription label.
PrefField
public PrefField()
showme
public abstract void showme(PrefFrame p)
- Shows this field component in a frame.
- Parameters:
- p - is the frame that will receive the component.
- Returns:
- none.
getValue
public abstract Object getValue()
- Return the actual value for that field.
- Returns:
- the value.
setValue
public abstract void setValue(Object newval)
- Allows to set the value for that field.
- Parameters:
- newval - is the new value.
- Returns:
- none.
isModified
public abstract boolean isModified()
- Indicates if the field has been changed by the user during
interactive editing.
- Returns:
- the answer.
applyModification
public abstract boolean applyModification()
- Applies the modification by loading the new value in the current value.
- Returns:
- true if the modification is valid, false otherwise. The modification
is applied only if valid.
cancel
public abstract void cancel()
- the appearance of that field returns to it's initial value.
- Returns:
- none.
isOK
public abstract boolean isOK()
- Returns whether the value selected by the user is valid.
- Returns:
- true if and only if the new value, selected by the user,
can replace the previous one (is allowed).
setDescription
public void setDescription(String newdesc)
- Set the description.
- Parameters:
- newdesc - is the new description
- Returns:
- none.
getDescription
public String getDescription()
- Gets the description.
- Returns:
- the description.
newName
public void newName(String newname)
- Select a new name. The input string should not be null.
- Parameters:
- newname - is the new name. Nothing is done if the
string is null.
- Returns:
- none.
getName
public String getName()
- This method returns the name of that field.
- Returns:
- the string name.
registerForNotify
public boolean registerForNotify(String me)
- This method register objects which will be notified when this field
value will be changed by the user.
- Parameters:
- me - is the classname (fully qualified) to notify.
The class must implement an PrefNotify interface.
- Returns:
- true iff the class exists and implements a PrefNotify interface.
- See Also:
- PrefNotify
removeFromNotify
public boolean removeFromNotify(String classname)
- This method removes a registered notify class. If classname is null,
false is returned.
- Parameters:
- classname - is the fully qualified class name to remove.
- Returns:
- true iff this class was registered and has been removed.
listNotify
public Enumeration listNotify()
- This returns the list of classes that will be notified
when the user changes this field.
- Returns:
- an enumeration of all notified classename.
- See Also:
- PrefNotify
notifyChange
protected void notifyChange(String groupName)
- Notify the registered classes. Usually called by PrefGroup when updating data.
- Parameters:
- groupName - is the name of the group where belongs this modified field.
- Returns:
- none.
All Packages Class Hierarchy This Package Previous Next Index