Class semper.preferences.PrefFieldString
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.preferences.PrefFieldString

java.lang.Object
   |
   +----semper.preferences.PrefField
           |
           +----semper.preferences.PrefFieldString

public class PrefFieldString
extends PrefField
String fields are formed by a label followed by a string input component. A String field may be used for entering a string subject to some constraints.
Version:
$Revision: 1.13 $ $Date: 1997/01/17 19:53:10 $
Author:
Louis Salvail
See Also:
PrefFieldLabel, PrefFieldChoice, PrefFieldNegotiable, PrefFieldCheckBox, StringConstraints

Constructor Index

 o PrefFieldString()
This constructor is used mostly to internalize this object.
 o PrefFieldString(String, String, String, int)
Constructor for strings fields with defaults gridBag constraints.
 o PrefFieldString(String, String, String, int, GridBagConstraints)
Constructor for strings fields.The String constraints is set to NoStringConstraints

Method Index

 o applyModification()
Apply the modification made by the user to the internal value of that field.
 o cancel()
This method set the Text field to the intial value.
 o getConstraints()
Returns the StringConstraints for that field.
 o getValue()
returns the string value for that field.
 o isModified()
Returns whether or not this field has been changed by the user.
 o isOK()
Returns whether or not the String field satisfies the constraints.
 o myStreamSize()
Returns the size of the stream that would hold the externalized form of this field.
 o readObject(StreamInputInterface)
Internalizes this string field from a stream.
 o setStringConstraints(StringConstraints)
Set constraints for that string field.
 o setValue(Object)
Set a string value.
 o showme(PrefFrame)
put this field appearance in a frame.
 o writeObject(StreamOutputInterface)
Externalizes this string field to a stream.

Constructors

 o PrefFieldString
  public PrefFieldString(String fieldname,
                         String fieldLabel,
                         String startval,
                         int width) throws PreferencesException
Constructor for strings fields with defaults gridBag constraints. The String constraints is set to NoStringConstraints. That means that any string is allowed for this field.
Parameters:
fieldname - is the string by which this component is accessed through the preferences manager. should not be null.
fieldLabel - is the label appearing before the text area. Should not be null.
startval - is the starting string value. Should not be null.
width - is the witdth of the input area.
Returns:
the new object.
Throws: PreferencesException
when one of the input string has a null value.
 o PrefFieldString
  public PrefFieldString(String fieldname,
                         String fieldLabel,
                         String startval,
                         int width,
                         GridBagConstraints constraint) throws PreferencesException
Constructor for strings fields.The String constraints is set to NoStringConstraints
Parameters:
fieldname - is the string by which this component is accessed through the preferences manager. The string should not be null.
fieldLabel - is the label appearing before the text area.This string should not be null.
startval - is the starting string value. Should not be null. This string shoud not be null.
width - is the witdth of the input area.
constraints - is the set of GridBagConstraints for that component. The internal constraints representation is a clone of the input.
Returns:
the new object.
Throws: PreferencesException
when at least one of the input string is null.
See Also:
GridBagConstraints
 o PrefFieldString
  public PrefFieldString()
This constructor is used mostly to internalize this object.
Returns:
a new empty object.

Methods

 o setStringConstraints
  public void setStringConstraints(StringConstraints c) throws StringConversionException
Set constraints for that string field.
Parameters:
c - is the constraints.
Returns:
none.
Throws: StringConversionException
when the actual value does not satisfy the new constraints.
 o getConstraints
  public StringConstraints getConstraints()
Returns the StringConstraints for that field.
Returns:
s the StringConstraints object.
See Also:
StringConstraints
 o showme
  public void showme(PrefFrame p)
put this field appearance in a frame.
Parameters:
p - is the frame where to put this field.
Returns:
none.
Overrides:
showme in class PrefField
 o getValue
  public Object getValue()
returns the string value for that field.
Returns:
the string recorded in this field.
Overrides:
getValue in class PrefField
 o setValue
  public void setValue(Object newval)
Set a string value.
Parameters:
newval - is the new string. If the new value is null then nothing is done.
Returns:
none.
Overrides:
setValue in class PrefField
 o isModified
  public boolean isModified()
Returns whether or not this field has been changed by the user.
Returns:
true if it has changed. Return always true when the actual value is null. Returns false otherwise.
Overrides:
isModified in class PrefField
 o applyModification
  public boolean applyModification()
Apply the modification made by the user to the internal value of that field. The modification is done only if the value is allowed according to the selected string constraint.
Returns:
true if and only if the new value is allowed.
Overrides:
applyModification in class PrefField
 o cancel
  public void cancel()
This method set the Text field to the intial value.
Returns:
none.
Overrides:
cancel in class PrefField
 o isOK
  public boolean isOK()
Returns whether or not the String field satisfies the constraints.
Returns:
true iff the constrains are satisfied according to the selected constraint.
Overrides:
isOK in class PrefField
 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
Overrides:
myStreamSize in class PrefField
See Also:
Streamable
 o readObject
  public void readObject(StreamInputInterface stream) throws StreamIOException
Internalizes this string field from a stream.
Parameters:
stream - is the stream of data the object state is retrieved from
Returns:
none.
Overrides:
readObject in class PrefField
See Also:
Streamable
 o writeObject
  public void writeObject(StreamOutputInterface stream) throws StreamIOException
Externalizes this string field to a stream.
Parameters:
stream - is the stream of data the object state is recorded in
Returns:
none
Overrides:
writeObject in class PrefField
See Also:
Streamable

All Packages  Class Hierarchy  This Package  Previous  Next  Index