public class GComboBox extends GComponent implements GDisplay, GClear, GListener, ActionListener
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GComboBox(int value,
int[] valueList,
String... labels)
Constructor.
|
GComboBox(int value,
String... labels)
Constructor.
|
GComboBox(String widgetId,
Enum<?> enumItem)
Constructor from an enum.
|
GComboBox(String widgetId,
int value,
int[] valueList,
String... labelList)
Constructor.
|
GComboBox(String widgetId,
int value,
int[] valueList,
String[] labelList,
String[] toolTipsList)
Constructor.
|
GComboBox(String widgetId,
int value,
String... labels)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
after(GEvent e)
Called after the event is processed.
|
void |
before(GEvent e)
Called before the event is processed.
|
void |
clear()
Called when the element is to be cleared, so it can perform the actions required to return to the last
saved/loaded values.
|
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
String[] |
getDefaultLabelList()
Get the default list of labels associated with the combobox.
|
int |
getDefaultValue()
Get the default value of the list.
|
Enum<?> |
getDefaultValueEnum()
Get the default value of the list.
|
String |
getDefaultValueLabel()
Get the label corresponding to the the default value of the list.
|
int[] |
getDefaultValueList()
Get the default list of values associated with the combobox.
|
String[] |
getErrorLabelList()
Get the list of labels associated to ERROR status.
|
static int[] |
getIndexesArray(Enum<?> enumItem)
Gets an ordered array of integers with the indexes of each item contained in the enumerate.
|
JComboBox |
getJComboBox()
Get the JComboBox associated with the widget.
|
String[] |
getLabelList()
Get the list of labels associated with the combobox.
|
static String[] |
getNamesArray(Enum<?> enumItem)
Gets an ordered array of strings with the names of each item contained in the enumerate.
|
String |
getSelectedItem()
Return the label of the selected item.
|
Integer |
getValue()
Return the value of the selected item.
|
Enum<?> |
getValueEnum()
Return the value of the selected item.
|
int |
getValueForRank(int rank)
Return the value corresponding to rank.
|
int[] |
getValueList()
Get the list of values associated with the combobox.
|
String[] |
getWarningLabelList()
Get the list of labels associated to WARNING status.
|
boolean |
isEnumCompat(Enum<?> value)
Check compatibility of an enum item with the combobox.
|
void |
setDefaultValue(Enum<?> value)
Change the default value of the list.
|
void |
setDefaultValue(int value)
Change the default value of the list.
|
void |
setDefaultValueList(Enum<?> enumItem,
Enum<?>[] enumItemList)
Change the list of default values.
|
void |
setDefaultValueList(int value,
int[] valueList,
String... labelList)
Change the list of default values.
|
void |
setDefaultValueList(int value,
int[] valueList,
String[] labelList,
String[] tooltipsList)
Change the list of default values.
|
void |
setErrorLabelList(String[] mErrorLabelList)
Set the error label list.
|
void |
setTooltipsList(String[] tooltipsList)
Setter of tooltips to each item in the combo box.
|
void |
setValue(Enum<?> value)
Set the selected item by value.
|
void |
setValue(int value)
Set the selected item by value.
|
void |
setValueList(Enum<?> enumItem,
Enum<?>[] enumItemList)
Change the list of values, the selected value and the labels of the combobox by means of an enumerate.
|
void |
setValueList(int value,
int[] valueList,
String... labelList)
Change the list of values, the selected value and the labels of the combobox.
|
void |
setValueList(int value,
int[] valueList,
String[] labelList,
String[] toolTipsList)
Change the list of values, the selected value and the labels of the combobox.
|
void |
setWarningLabelList(String[] mWarningLabelList)
Set the warning label list.
|
void |
updateStatus()
Update the status of the combobox depending on the selected item.
|
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setEnabled, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GComboBox(int value, String... labels)
value
- index of the selected item.labels
- for the different items.public GComboBox(String widgetId, int value, String... labels)
widgetId
- identifier of the widget.value
- index of the selected item.labels
- for the different items.public GComboBox(int value, int[] valueList, String... labels)
value
- index of the selected item.valueList
- list of values for the items.labels
- for the different items.public GComboBox(String widgetId, int value, int[] valueList, String... labelList)
widgetId
- identifier of the widget.value
- index of the selected item.valueList
- list of values for the items.labelList
- for the different items.public GComboBox(String widgetId, Enum<?> enumItem)
widgetId
- identifier of the widget.enumItem
- initially selected item of the enumerate of itemspublic GComboBox(String widgetId, int value, int[] valueList, String[] labelList, String[] toolTipsList)
widgetId
- identifier of the widget.value
- index of the selected item.valueList
- list of values for the items.labelList
- for the different items.toolTipsList
- for the different items.public static int[] getIndexesArray(Enum<?> enumItem)
enumItem
- enumerate single item.Enum.ordinal()
method)public static String[] getNamesArray(Enum<?> enumItem)
enumItem
- enumerate single item.Enum.toString()
method)public String[] getErrorLabelList()
public String[] getWarningLabelList()
public void setErrorLabelList(String[] mErrorLabelList)
mErrorLabelList
- List of labels that should update the status to ERROR level.public void setWarningLabelList(String[] mWarningLabelList)
mWarningLabelList
- List of labels that should update the status to WARNING level.public final void updateStatus()
public void display()
GDisplay
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public Component getComponent()
GComponent
getComponent
in class GComponent
public JComboBox getJComboBox()
public String getSelectedItem()
public int getValueForRank(int rank)
rank
- of the value to get.public Integer getValue()
public Enum<?> getValueEnum()
public int[] getDefaultValueList()
public String[] getDefaultLabelList()
public int[] getValueList()
public String[] getLabelList()
public final void setValue(Enum<?> value)
value
- of the item to select.public final void setValue(int value)
value
- of the item to select.public void setValueList(int value, int[] valueList, String... labelList)
value
- new value to select.valueList
- new value list, it can be null if the values are the indexes of the elements in the
combobox.labelList
- to display in the combobox.public void setValueList(int value, int[] valueList, String[] labelList, String[] toolTipsList)
value
- new value to select.valueList
- new value list, it can be null if the values are the indexes of the elements in the
combobox.labelList
- to display in the combobox.toolTipsList
- to display for each element in the combobox.public void setValueList(Enum<?> enumItem, Enum<?>[] enumItemList)
enumItem
- new enumerate item to select.enumItemList
- new enumerate items list.public void setDefaultValueList(int value, int[] valueList, String... labelList)
value
- new default value.valueList
- new default value list.labelList
- new default label list.public void setDefaultValueList(int value, int[] valueList, String[] labelList, String[] tooltipsList)
value
- new default value.valueList
- new default value list.labelList
- new default label list.tooltipsList
- new default tooltips list.public void setDefaultValueList(Enum<?> enumItem, Enum<?>[] enumItemList)
enumItem
- new enumerate item to be set as default one.enumItemList
- new enumerate items list to be set as default one.public void setDefaultValue(Enum<?> value)
value
- new default value.public void setDefaultValue(int value)
value
- new default value.public int getDefaultValue()
public Enum<?> getDefaultValueEnum()
public String getDefaultValueLabel() throws GException
GException
- in case of empty list of labels, empty list of values, different length for the lists or
value not found in the list of values.public void clear() throws GException
GClear
clear
in interface GClear
GException
- in case of problem while clearing the values.public void setTooltipsList(String[] tooltipsList)
tooltipsList
- the ordered list of tooltips to be set.public boolean isEnumCompat(Enum<?> value)
value
- enum item to checkpublic void before(GEvent e) throws GException
before
in interface GListener
e
- event to processed.GException
- in case there is a problem managing the event.public void after(GEvent e) throws GException
after
in interface GListener
e
- processed event.GException
- in case there is a problem managing the event.Copyright © 2024. All rights reserved.