Class ListSelectionPart
- java.lang.Object
-
- net.sf.okapi.common.uidescription.AbstractPart
-
- 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
Fields Modifier and Type Field Description static intLISTTYPE_DROPDOWNstatic intLISTTYPE_SIMPLE-
Fields inherited from class net.sf.okapi.common.uidescription.AbstractPart
container, enabledOnSelection, labelFlushed, labelNextToInput, masterPart, paramDescriptor, vertical, withLabel
-
-
Constructor Summary
Constructors Constructor Description ListSelectionPart(ParameterDescriptor paramDescriptor, String[] choicesValues)Creates a new ListSelectionPart object with a given parameter descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckType()Checks the types supported by this UI part.String[]getChoicesLabels()Gets the list of the localizable labels to use with the selectable values.String[]getChoicesValues()Gets the list of items that can be selected.intgetListType()Gets the type of list this UI part should use.voidsetChoicesLabels(String[] choicesLabels)Sets the list of the localizable labels to use with the selectable values.voidsetChoicesValues(String[] choicesValues)Sets the list of items that can be selected.voidsetListType(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, isLabelNextToInput, isVertical, isWithLabel, setContainer, setDisplayName, setLabelFlushed, setLabelNextToInput, setMasterPart, setShortDescription, setVertical, setWithLabel
-
-
-
-
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, 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:AbstractPartChecks the types supported by this UI part.- Overrides:
checkTypein classAbstractPart
-
getChoicesValues
public String[] getChoicesValues()
Gets the list of items that can be selected.- Returns:
- the list of items that can be selected.
-
setChoicesValues
public void setChoicesValues(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:
LISTTYPE_SIMPLEfor a a simple list-
LISTTYPE_DROPDOWNfor a drop-down list
- Parameters:
listType- the new type of list this UI part should use.
-
getChoicesLabels
public 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(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.
-
-