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

Class semper.preferences.PrefFieldList

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

public class PrefFieldList
extends PrefField
This represents a List of strings items from which it is possible to choose.
Version:
$Revision: 1.3 $ $Date: 1997/01/21 14:56:38 $
Author:
Louis Salvail
See Also:
PrefFieldString, PrefFieldLabel, PrefFieldNegotiable, PrefFieldCheckBox, PrefFieldChoice

Constructor Index

 o PrefFieldList()
Constructor used by newInstance() when this object is internalized.
 o PrefFieldList(String, String, boolean, int)
Constructor for an empty choice with defaults constraints.
 o PrefFieldList(String, String, boolean, int, GridBagConstraints)
Constructor for an empty choice.

Method Index

 o addInList(String)
This allows to add a new string in the list.
 o applyModification()
Apply user modifications to this list.
 o cancel()
Cancel user's actions.
 o getItem(int)
This returns the string at the given index.
 o getItem(Integer)
This returns the string at the given index.
 o getLabel()
Returns the label appearing on top of the list.
 o getStringsValue()
Gets the selected string(s) for that field.
 o getValue()
Returns a vector of selected items.
 o getVectorValue()
Returns a vector of selected items with no need for type casting.
 o isModified()
Tells if the selected items changed.
 o isOK()
Returns always true.
 o multiSelectionAllowed()
Returns whether or not this List field allows multiselection.
 o myStreamSize()
Returns the size of the stream that would hold the externalized form of this field.
 o readObject(StreamInputInterface)
Internalizes this field.
 o setValue(int)
Similar to the previous setValue(Integer newval) method.
 o setValue(int[])
Set the selected values for the list.
 o setValue(Integer)
Set the item at the given index.
 o setValue(Object)
Same thing than setValue(int[] newval).
 o setValue(String)
Set the item describes by the input string.
 o setValue(String[])
Set the items describe by the input array of strings.
 o showme(PrefFrame)
This adds the approriate choice to a frame.
 o writeObject(StreamOutputInterface)
Externalizes this field.

Constructors

 o PrefFieldList
  public PrefFieldList(String fieldname,
                       String chLabel,
                       boolean multipleSelection,
                       int visibleLines,
                       GridBagConstraints constraints)
Constructor for an empty choice.
Parameters:
fieldname - is the string by which this component is accessed through the preferences manager.
chLabel - is the string appearing at the right of the choice component.
multipleSelection - is a boolean that indicates whether or not multiple selection are allowed.
visibleLines - is the number of visible lines for that list.
constraints - is the set of GridBagConstraints for that component.
Returns:
the new empty object.
Throws: PreferencesException
when one of the String arguments is null.
See Also:
GridBagConstraints
 o PrefFieldList
  public PrefFieldList(String fieldname,
                       String chLabel,
                       boolean multipleSelection,
                       int visibleLines) throws PreferencesException
Constructor for an empty choice with defaults constraints.
Parameters:
fieldname - is the string by which this component is accessed through the preferences manager.
chLabel - is the string appearing at the right of the choice component.
multipleSelection - indicates whether or not multiple selections are allowed
visibleLines - is the number of visible list for the list.
Returns:
the new empty object.
See Also:
GridBagConstraints
 o PrefFieldList
  public PrefFieldList()
Constructor used by newInstance() when this object is internalized. Otherwise, you should not use this constructor.
Returns:
a new empty object.

Methods

 o addInList
  public void addInList(String item)
This allows to add a new string in the list.
Parameters:
item - is the string describing this choice
Returns:
none.
 o multiSelectionAllowed
  public boolean multiSelectionAllowed()
Returns whether or not this List field allows multiselection.
Returns:
true if and only if the list allow multiselection.
 o showme
  public void showme(PrefFrame p)
This adds the approriate choice to a frame.
Parameters:
p - is the frame where the object will be shown.
Returns:
none.
Overrides:
showme in class PrefField
 o getValue
  public Object getValue()
Returns a vector of selected items.
Returns:
a vector of selected indexes. If nothing is selected then an empty vector is returned.
Overrides:
getValue in class PrefField
 o getVectorValue
  public Vector getVectorValue()
Returns a vector of selected items with no need for type casting.
Returns:
a vector of selected indexes. If nothing is selected then an empty vector is returned.
 o getStringsValue
  public String[] getStringsValue()
Gets the selected string(s) for that field. That is the strings selected in the internal value for this field.
Returns:
a vector containing the selected strings. A vector of length 0 is returned if no selection has been made.
 o getItem
  public String getItem(int index)
This returns the string at the given index. Null is returned if the index is not in the list. The first element has index=0.
Parameters:
index - is the index in the list
Returns:
the item at the index position. Null if the index is not valid.
See Also:
List
 o getItem
  public String getItem(Integer index)
This returns the string at the given index. Null is returned if the index is not in the list.
Parameters:
index - is an Integer representing the index in the list.
Returns:
the item at the index position. Null if the index is not valid.
 o setValue
  public void setValue(int newval[])
Set the selected values for the list. The input parameter is an array of indices to select. If the list does not support multiple selections, only the first element is selected.
Parameters:
newval - is an array of int. If the list support multiple selections, then the items newval[i] will be selected (the other position will be unselected). If the list does not support multiple selections, newval[0] will be selected. Only newval[i] in the items range will be selected.
Returns:
none.
 o setValue
  public void setValue(Object newval)
Same thing than setValue(int[] newval).
Parameters:
newval - is an Object encoding an array of int.
Returns:
none.
Overrides:
setValue in class PrefField
 o setValue
  public void setValue(Integer newval)
Set the item at the given index.
Parameters:
newval - is the index of the selection. If not in the range nothing is done. In case of a multiselection list the selection is added to the previous ones. The first index is 0.
Returns:
none.
 o setValue
  public void setValue(int newval)
Similar to the previous setValue(Integer newval) method.
Parameters:
newval - is the index of the selection. If not in the range nothing is done. In case of a multiselection list the selection is added to the previous ones. The first index is 0.
Returns:
none.
 o setValue
  public boolean setValue(String s)
Set the item describes by the input string.
Parameters:
s - is the string to select.
Returns:
true if and only if the string s is in the list and has been selected. If the list contains more than one occurence of the input string, all of them will be selected in case of multiselection and the last one will be selected in case of unique selection.
 o setValue
  public boolean setValue(String s[])
Set the items describe by the input array of strings.
Parameters:
s - is the array of strings to be selected.
Returns:
true if and only if each strings has been found and selected.
 o getLabel
  public String getLabel()
Returns the label appearing on top of the list.
Returns:
the string label.
 o isModified
  public boolean isModified()
Tells if the selected items changed.
Returns:
true iff the set of selected items has changed.
Overrides:
isModified in class PrefField
 o applyModification
  public boolean applyModification()
Apply user modifications to this list.
Returns:
true iff modification have been applied.
Overrides:
applyModification in class PrefField
 o isOK
  public boolean isOK()
Returns always true.
Returns:
true.
Overrides:
isOK in class PrefField
 o cancel
  public void cancel()
Cancel user's actions.
Returns:
none.
Overrides:
cancel 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 field.
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 field. Writes 1)# of visible lines, 2)whether multiple selection are allowed, 3) items list, 4) vector val, 5)label.
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