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

Variable Index

 o csts
the GridBagConstraints for that component
 o defCsts
 o noDescription
Default no decription label.

Constructor Index

 o PrefField()

Method Index

 o applyModification()
Applies the modification by loading the new value in the current value.
 o cancel()
the appearance of that field returns to it's initial value.
 o getDescription()
Gets the description.
 o getName()
This method returns the name of that field.
 o getValue()
Return the actual value for that field.
 o isModified()
Indicates if the field has been changed by the user during interactive editing.
 o isOK()
Returns whether the value selected by the user is valid.
 o listNotify()
This returns the list of classes that will be notified when the user changes this field.
 o newName(String)
Select a new name.
 o notifyChange(String)
Notify the registered classes.
 o registerForNotify(String)
This method register objects which will be notified when this field value will be changed by the user.
 o removeFromNotify(String)
This method removes a registered notify class.
 o setDescription(String)
Set the description.
 o setValue(Object)
Allows to set the value for that field.
 o showme(PrefFrame)
Shows this field component in a frame.

Variables

 o defCsts
 public static GridBagConstraints defCsts
 o csts
 public GridBagConstraints csts
the GridBagConstraints for that component

 o noDescription
 protected static final String noDescription
Default no decription label.

Constructors

 o PrefField
 public PrefField()

Methods

 o 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.
 o getValue
 public abstract Object getValue()
Return the actual value for that field.

Returns:
the value.
 o setValue
 public abstract void setValue(Object newval)
Allows to set the value for that field.

Parameters:
newval - is the new value.
Returns:
none.
 o isModified
 public abstract boolean isModified()
Indicates if the field has been changed by the user during interactive editing.

Returns:
the answer.
 o 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.
 o cancel
 public abstract void cancel()
the appearance of that field returns to it's initial value.

Returns:
none.
 o 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).
 o setDescription
 public void setDescription(String newdesc)
Set the description.

Parameters:
newdesc - is the new description
Returns:
none.
 o getDescription
 public String getDescription()
Gets the description.

Returns:
the description.
 o 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.
 o getName
 public String getName()
This method returns the name of that field.

Returns:
the string name.
 o 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
 o 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.
 o 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
 o 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