public class GComboBoxWithLabel extends GContainer implements GDisplay, GReadWrite, GListener, GClear
GComboBox
with a GComboBoxWithLabel
and adds the GReadWrite
interface
to save/load the selected value from the configuration file. The class allows a sole choice with the same
function as the function of GChoice
but the interface is implemented via a pop up menu GComboBox
instead of a group of GRadioButtons.Index | Class | Item | Constraint |
0 | GLabelWithIndicator | label | 0, 0 => "newline , split 2" 0, 1 => (null) |
1 | GComboBox | combobox | (null) |
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GComboBoxWithLabel()
Constructor by default.
|
GComboBoxWithLabel(String label,
int value,
int[] values,
String... labels)
Constructor.
|
GComboBoxWithLabel(String label,
int value,
String... labels)
Constructor.
|
GComboBoxWithLabel(String widgetId,
String label,
Enum<?> enumItem)
Constructor.
|
GComboBoxWithLabel(String widgetId,
String label,
int value,
int[] valueList,
String... labelList)
Constructor.
|
GComboBoxWithLabel(String widgetId,
String label,
int value,
int[] valueList,
String[] labelList,
String[] toolTipsList)
Constructor.
|
GComboBoxWithLabel(String widgetId,
String label,
int value,
String... labels)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
after(GEvent e)
Called after the event is processed.
|
void |
attachCopyPasteMenu(String label,
GComponent.CopyPasteOperation... operationList)
Attach the copy and paste menu to this component.
|
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.
|
void |
generic()
The prototype of the generic function that shall exist in all the descendants.
|
int |
getDefaultValue()
Get the default value when calling clear.
|
Enum<?> |
getDefaultValueEnum()
Get the default value.
|
String[] |
getErrorLabelsList()
Get the list of labels that makes the combo box to be in error status.
|
GComboBox |
getGComboBox()
Return the GComboBox component.
|
GLabelWithIndicator |
getGLabelWithIndicator()
Return the GLabel component.
|
int |
getSavedValue()
Get the saved value.
|
Enum<?> |
getSavedValueEnum()
Get the saved value.
|
String |
getSelectedItem()
Return the label of the selected item.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
Integer |
getValue()
Get the selected value.
|
Enum<?> |
getValueEnum()
Get the selected value.
|
String[] |
getWarningLabelsList()
Get the list of labels that makes the combo box to be in warning status.
|
GComponent.CopyPasteOperation |
isCopyPasteEvent(GEvent event)
Checks if the event corresponds to one of the copy and paste menu operations.
|
boolean |
isEnabled()
Gets the enable status of the widget.
|
boolean |
isModified()
Gets the modification status of the component against the last set of values loaded or saved.
|
void |
read()
Implementaion of the routines that allow the component to be loaded from a configuration file.
|
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 default list of values, the value and labels of the combobox.
|
void |
setDefaultValueList(int value,
int[] valueList,
String[] labels)
Change the default list of values, the value and labels of the combobox.
|
void |
setDefaultValueList(int value,
int[] valueList,
String[] labels,
String[] tooltips)
Change the default list of values, the value and labels of the combobox.
|
void |
setEnabled(boolean b)
Set the enable status of the component.
|
void |
setErrorLabelsList(String... errorLabels)
Set the list of labels that makes the combo box to be in error status.
|
void |
setSavedValue(Enum<?> value)
Change the saved value.
|
void |
setSavedValue(int value)
Change the saved value.
|
void |
setStringConstraint(String constraints)
Set the constraints for the components.
|
void |
setTooltipsList(String[] tooltipsList)
Setter of tooltips to each item in the combo box.
|
void |
setToolTipText(String text)
Set the tooltip text for the entry's label.
|
void |
setValue(Enum<?> value)
Set a new value.
|
void |
setValue(int value)
Set a new 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... labels)
Change the list of values, the selected value and the labels of the combobox.
|
void |
setValueList(int value,
int[] valueList,
String[] labels,
String[] tooltips)
Change the list of values, the selected value and the labels of the combobox.
|
void |
setWarningLabelsList(String... warningLabels)
Set the list of labels that makes the combo box to be in warning status.
|
void |
setWidgetId(String widgetId)
Sets the widget identifier of the component.
|
protected void |
updateIsModifiedIndicator()
Updates the is modified indicator.
|
void |
updateStatus()
Update the status of the combobox depending on the selected item.
|
void |
write()
Implementaion of the routines that allow the component to be saved to a configuration file.
|
put
activateConstraintsByType, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getComponent, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isForcedStatus, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setWidth, setWindowBusyCursor, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GComboBoxWithLabel()
public GComboBoxWithLabel(String widgetId, String label, int value, String... labels)
widgetId
- widget identifier.label
- to display on the side of the combobox.value
- selected value.labels
- labels of the choices.public GComboBoxWithLabel(String label, int value, String... labels)
label
- to display on the side of the combobox.value
- selected value.labels
- labels of the choices.public GComboBoxWithLabel(String label, int value, int[] values, String... labels)
label
- to display on the side of the combobox.value
- selected value.values
- values for the different choices.labels
- labels of the choices.public GComboBoxWithLabel(String widgetId, String label, int value, int[] valueList, String... labelList)
widgetId
- widget identifier.label
- to display on the side of the combobox.value
- selected value.valueList
- values for the different choices.labelList
- labels for the different choices.public GComboBoxWithLabel(String widgetId, String label, Enum<?> enumItem)
widgetId
- widget identifier.label
- to display on the side of the combobox.enumItem
- initially selected item of the enumerate of itemspublic GComboBoxWithLabel(String widgetId, String label, int value, int[] valueList, String[] labelList, String[] toolTipsList)
widgetId
- widget identifier.label
- to display on the side of the combobox.value
- selected value.valueList
- values for the different choices.labelList
- labels for the different choices.toolTipsList
- tooltips for the different choices.public final void setWidgetId(String widgetId)
setWidgetId
in class GComponent
widgetId
- the widget identifier of the component.public GComponent getSubComponent(int position) throws GComponentException
getSubComponent
in class GComponent
position
- position of the requested component.GComponentException
- in case the position argument is invalid.public void generic() throws GException
generic
in class GContainer
GException
- In case of problem.public void display() throws GException
display
in interface GDisplay
GException
- in case of problem while reading the value from file.public boolean isEnabled()
isEnabled
in class GComponent
public void setEnabled(boolean b)
setEnabled
in class GComponent
b
- new enable status of the component.public boolean isModified()
GComponent
isModified
in class GComponent
protected final void updateIsModifiedIndicator()
updateIsModifiedIndicator
in class GComponent
public int getDefaultValue()
public Enum<?> getDefaultValueEnum()
public final Integer getValue()
public Enum<?> getValueEnum()
public String getSelectedItem()
public void setValue(int value)
value
- to set.public void setValue(Enum<?> value)
value
- to set.public GLabelWithIndicator getGLabelWithIndicator()
public void setValueList(int value, int[] valueList, String... labels)
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.labels
- to display in the combobox.public void setValueList(int value, int[] valueList, String[] labels, String[] tooltips)
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.labels
- to display in the combobox.tooltips
- 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[] labels)
value
- new default value.valueList
- new default value list.labels
- new default value 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 setDefaultValueList(int value, int[] valueList, String[] labels, String[] tooltips)
value
- new default value.valueList
- new default value list.labels
- new default value list.tooltips
- new default tooltips list.public void setDefaultValue(int value)
value
- default value to set.public void setDefaultValue(Enum<?> value)
value
- default value to set.public GComboBox getGComboBox()
public void attachCopyPasteMenu(String label, GComponent.CopyPasteOperation... operationList)
attachCopyPasteMenu
in class GComponent
label
- of the copy&paste menu, if null no label is displayed.operationList
- list of operations to set in the menu. Valid values are Copy if the
"Copy" menu is available, Paste if the "Paste" menu is available, Import if the
"Import" menu is available, and Export if the "Export" menu is available.public void read() throws GException
GReadWrite
read
in interface GReadWrite
GException
- in case of problem while reading the value from file.public void write() throws GException
GReadWrite
write
in interface GReadWrite
GException
- in case of problem while writing the value to file.public void before(GEvent e) throws GException
GListener
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
GListener
after
in interface GListener
e
- processed event.GException
- in case there is a problem managing the event.public void clear() throws GException
GClear
clear
in interface GClear
GException
- in case of problem while clearing the values.public void setSavedValue(int value)
value
- new saved value.public void setSavedValue(Enum<?> value)
value
- new saved value.public int getSavedValue()
public Enum<?> getSavedValueEnum()
public void setToolTipText(String text)
setToolTipText
in class GComponent
text
- the tooltip text for the entry's label.public GComponent.CopyPasteOperation isCopyPasteEvent(GEvent event)
isCopyPasteEvent
in class GComponent
event
- to check.public void setTooltipsList(String[] tooltipsList)
tooltipsList
- the ordered list of tooltips to be set.public void setStringConstraint(String constraints)
setStringConstraint
in class GComponent
constraints
- to set.public void setErrorLabelsList(String... errorLabels)
errorLabels
- list of labels for error status.public String[] getErrorLabelsList()
public void setWarningLabelsList(String... warningLabels)
warningLabels
- list of labels for warning status.public String[] getWarningLabelsList()
public final void updateStatus()
Copyright © 2024. All rights reserved.