net.sf.okapi.common.uidescription
Class ListSelectionPart

java.lang.Object
  extended by net.sf.okapi.common.uidescription.AbstractPart
      extended by net.sf.okapi.common.uidescription.ListSelectionPart
All Implemented Interfaces:
IParameterDescriptor

public class ListSelectionPart
extends AbstractPart

UI part descriptor for a string selection. This UI part supports the following types: String and int.

Use setListType(int) to specify the type of list the UI should use. By default a simple list box will be used.


Field Summary
static int LISTTYPE_DROPDOWN
           
static int LISTTYPE_SIMPLE
           
 
Fields inherited from class net.sf.okapi.common.uidescription.AbstractPart
container, enabledOnSelection, labelFlushed, masterPart, paramDescriptor, vertical, withLabel
 
Constructor Summary
ListSelectionPart(ParameterDescriptor paramDescriptor, java.lang.String[] choicesValues)
          Creates a new ListSelectionPart object with a given parameter descriptor.
 
Method Summary
protected  void checkType()
          Checks the types supported by this UI part.
 java.lang.String[] getChoicesLabels()
          Gets the list of the localizable labels to use with the selectable values.
 java.lang.String[] getChoicesValues()
          Gets the list of items that can be selected.
 int getListType()
          Gets the type of list this UI part should use.
 void setChoicesLabels(java.lang.String[] choicesLabels)
          Sets the list of the localizable labels to use with the selectable values.
 void setChoicesValues(java.lang.String[] choicesValues)
          Sets the list of items that can be selected.
 void setListType(int listType)
          Sets the type of list this UI part should use.
 
Methods inherited from class net.sf.okapi.common.uidescription.AbstractPart
getContainer, getDisplayName, getMasterPart, getName, getParent, getReadMethod, getShortDescription, getType, getWriteMethod, isEnabledOnSelection, isLabelFlushed, isVertical, isWithLabel, setContainer, setDisplayName, setLabelFlushed, setMasterPart, setShortDescription, setVertical, setWithLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LISTTYPE_SIMPLE

public static final int LISTTYPE_SIMPLE
See Also:
Constant Field Values

LISTTYPE_DROPDOWN

public static final int LISTTYPE_DROPDOWN
See Also:
Constant Field Values
Constructor Detail

ListSelectionPart

public ListSelectionPart(ParameterDescriptor paramDescriptor,
                         java.lang.String[] choicesValues)
Creates a new ListSelectionPart object with a given parameter descriptor.

Parameters:
paramDescriptor - the parameter descriptor for this UI part.
choicesValues - the list of the items that can be selected. When the type of the parameter is an int, the list of values must be defined.
Method Detail

checkType

protected void checkType()
Description copied from class: AbstractPart
Checks the types supported by this UI part.

Overrides:
checkType in class AbstractPart

getChoicesValues

public java.lang.String[] getChoicesValues()
Gets the list of items that can be selected.

Returns:
the list of items that can be selected.

setChoicesValues

public void setChoicesValues(java.lang.String[] choicesValues)
Sets the list of items that can be selected.

Parameters:
choicesValues - the new list of items that can be selected.

getListType

public int getListType()
Gets the type of list this UI part should use.

Returns:
the type of list this UI part should use.

setListType

public void setListType(int listType)
Sets the type of list this UI part should use.

The possible values are:

Parameters:
listType - the new type of list this UI part should use.

getChoicesLabels

public java.lang.String[] getChoicesLabels()
Gets the list of the localizable labels to use with the selectable values.

Returns:
the list of the localizable labels to use with the selectable values.

setChoicesLabels

public void setChoicesLabels(java.lang.String[] choicesLabels)
Sets the list of the localizable labels to use with the selectable values. If this list is not set, the values themselves will be used for display.

Parameters:
choicesLabels - the list of the localizable labels to use with the selectable values.