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.18 $ $Date: 1998/04/07 12:40:30 $
- Author:
- Louis Salvail
- See Also:
- PrefFieldLabel, PrefFieldChoice, PrefFieldNegotiable, PrefFieldCheckBox, StringConstraints
-
PrefFieldString()
-
This constructor is used mostly to internalize this object.
-
PrefFieldString(String, String, String, int)
-
Constructor for strings fields with defaults gridBag constraints.
-
PrefFieldString(String, String, String, int, boolean)
-
-
PrefFieldString(String, String, String, int, GridBagConstraints)
-
Constructor for strings fields.The String constraints
is set to NoStringConstraints
-
applyModification()
-
Apply the modification made by the user to the internal
value of that field.
-
cancel()
-
This method set the Text field to the intial value.
-
getConstraints()
-
Returns the StringConstraints for that field.
-
getValue()
-
returns the string value for that field.
-
isModified()
-
Returns whether or not this field has been changed by the user.
-
isOK()
-
Returns whether or not the String field satisfies the constraints.
-
setStringConstraints(StringConstraints)
-
Set constraints for that string field.
-
setValue(Object)
-
Set a string value.
-
showme(PrefFrame)
-
put this field appearance in a frame.
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.
PrefFieldString
public PrefFieldString(String fieldname,
String fieldLabel,
String startval,
int width,
boolean echo)
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
PrefFieldString
public PrefFieldString()
- This constructor is used mostly to internalize this object.
- Returns:
- a new empty object.
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.
getConstraints
public StringConstraints getConstraints()
- Returns the StringConstraints for that field.
- Returns:
- s the StringConstraints object.
- See Also:
- StringConstraints
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
getValue
public Object getValue()
- returns the string value for that field.
- Returns:
- the string recorded in this field.
- Overrides:
- getValue in class PrefField
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
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
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
cancel
public void cancel()
- This method set the Text field to the intial value.
- Returns:
- none.
- Overrides:
- cancel in class PrefField
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
All Packages Class Hierarchy This Package Previous Next Index