Class semper.preferences.PrefField
All Packages Class Hierarchy This Package Previous Next Index
Class semper.preferences.PrefField
java.lang.Object
|
+----semper.preferences.PrefField
- public class PrefField
- extends Object
- implements Streamable
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. Since this class is abstract, no constructor should
is given.
- Version:
- $Revision: 1.13 $ $Date: 1997/03/14 13:47:33 $
- 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.
-
myStreamSize()
- Returns the size of the stream that would hold the externalized form of this field.
-
newName(String)
- Select a new name.
-
notifyChange(String)
- Notify the registered classes.
-
readObject(StreamInputInterface)
- Internalizes this field.
-
registerForNotify(String)
- This method register objects which will be notified when this field
value will be changed by the user.
-
removeFromNotify(String)
- This method remove a registered notify class.
-
setDescription(String)
- Set the description.
-
setValue(Object)
- Allows to set the value for that field.
-
showDescription(PrefFrame)
- This method shows the description associated with that field in a confirmbox.
-
showme(PrefFrame)
- Shows this field component in a frame.
-
writeObject(StreamOutputInterface)
- Externalizes this field.
defCsts
public static GridBagConstraints defCsts
csts
public GridBagConstraints csts
- the GridBagConstraints for that component
noDescription
protected final static 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 remove 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.
myStreamSize
public int myStreamSize() throws StreamIOException
- Returns the size of the stream that would hold the externalized form of this field.
- Returns:
- the size of the stream in bytes
- See Also:
- Streamable
readObject
public void readObject(StreamInputInterface stream) throws StreamIOException
- Internalizes this field.
- Parameters:
- stream - is the stream of data the object state is retrieved from
- Returns:
- none.
- See Also:
- Streamable
writeObject
public void writeObject(StreamOutputInterface stream) throws StreamIOException
- Externalizes this field.
- Parameters:
- stream - is the stream of data the object state is recorded in
- Returns:
- none
- See Also:
- Streamable
showDescription
public synchronized void showDescription(PrefFrame parent)
- This method shows the description associated with that field in a confirmbox.
The description is shown when the user press F1 while the mouse is over
the field.
- Parameters:
- parent - is the parent frame of the displayed confirmbox.
- Returns:
- none.
All Packages Class Hierarchy This Package Previous Next Index