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

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 myStreamSize()
Returns the size of the stream that would hold the externalized form of this field.
 o newName(String)
Select a new name.
 o notifyChange(String)
Notify the registered classes.
 o readObject(StreamInputInterface)
Internalizes this field.
 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 remove a registered notify class.
 o setDescription(String)
Set the description.
 o setValue(Object)
Allows to set the value for that field.
 o showDescription(PrefFrame)
This method shows the description associated with that field in a confirmbox.
 o showme(PrefFrame)
Shows this field component in a frame.
 o writeObject(StreamOutputInterface)
Externalizes this field.

Variables

 o defCsts
  public static GridBagConstraints defCsts
 o csts
  public GridBagConstraints csts
the GridBagConstraints for that component
 o noDescription
  protected final static 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 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.
 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.
 o 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
 o 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
 o 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
 o 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