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.6 $ $Date: 1997/09/26 16:29:31 $
- Author:
- Louis Salvail
- See Also:
- PrefFieldString, PrefFieldLabel, PrefFieldNegotiable, PrefFieldCheckBox, PrefFieldChoice
-
PrefFieldList()
-
Constructor used by newInstance() when this object is internalized.
-
PrefFieldList(String, String, boolean, int)
-
Constructor for an empty choice with defaults constraints.
-
PrefFieldList(String, String, boolean, int, GridBagConstraints)
-
Constructor for an empty choice.
-
addInList(String)
-
This allows to add a new string in the list.
-
applyModification()
-
Apply user modifications to this list.
-
cancel()
-
Cancel user's actions.
-
getItem(int)
-
This returns the string at the given index.
-
getItem(Integer)
-
This returns the string at the given index.
-
getLabel()
-
Returns the label appearing on top of the list.
-
getStringsValue()
-
Gets the selected string(s) for that field.
-
getValue()
-
Returns a vector of selected items.
-
getVectorValue()
-
Returns a vector of selected items with no need for type casting.
-
isModified()
-
Tells if the selected items changed.
-
isOK()
-
Returns always true.
-
multiSelectionAllowed()
-
Returns whether or not this List field allows
multiselection.
-
setValue(int)
-
Similar to the previous setValue(Integer newval) method.
-
setValue(int[])
-
Set the selected values for the list.
-
setValue(Integer)
-
Set the item at the given index.
-
setValue(Object)
-
Same thing than setValue(int[] newval).
-
setValue(String)
-
Set the item describes by the input string.
-
setValue(String[])
-
Set the items describe by the input array of strings.
-
showme(PrefFrame)
-
This adds the approriate choice to a frame.
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
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
PrefFieldList
public PrefFieldList()
- Constructor used by newInstance() when this object is internalized.
Otherwise, you should not use this constructor.
- Returns:
- a new empty object.
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.
multiSelectionAllowed
public boolean multiSelectionAllowed()
- Returns whether or not this List field allows
multiselection.
- Returns:
- true if and only if the list allow multiselection.
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
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
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.
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.
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
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.
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.
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
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.
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.
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.
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.
getLabel
public String getLabel()
- Returns the label appearing on top of the list.
- Returns:
- the string label.
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
applyModification
public boolean applyModification()
- Apply user modifications to this list.
- Returns:
- true iff modification have been applied.
- Overrides:
- applyModification in class PrefField
isOK
public boolean isOK()
- Returns always true.
- Returns:
- true.
- Overrides:
- isOK in class PrefField
cancel
public void cancel()
- Cancel user's actions.
- Returns:
- none.
- Overrides:
- cancel in class PrefField
All Packages Class Hierarchy This Package Previous Next Index