T
- type of object to be selected.public abstract class GObjectSelector<T> extends GContainer implements GDisplay, GListener
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GObjectSelector(String buttonTitle,
String dialogTitle,
String[] labelList,
T[] objectList,
String unitString)
Constructor.
|
GObjectSelector(String widgetId,
String buttonTitle,
String dialogTitle,
String[] labelList,
T[] objectList,
String unitString)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
after(GEvent e)
Called after the event is processed.
|
void |
before(GEvent e)
Called before the event is processed.
|
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.
|
GConstraint |
getConstraint()
Return the current component constraint.
|
T |
getObject()
Get the selected object or null if no object is currently selected.
|
protected abstract String |
getObjectValue(int comboboxValue)
Method to compose the string associated to the selected object to be used to fulfill the
object value label.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
boolean |
isEnabled()
Gets the enable status of the widget.
|
void |
setConstraint(GConstraint constraint)
Set the constraint for the component.
|
void |
setDialogTooltip(String text)
Set the tooltip to display in the dialog label.
|
void |
setEnabled(boolean flag)
Set the enable status of the component.
|
void |
setStringConstraint(String constraint)
Set the constraint in string format for the component.
|
void |
setToolTipText(String text)
Set the tooltip text for the entry's label.
|
put
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getComponent, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GObjectSelector(String buttonTitle, String dialogTitle, String[] labelList, T[] objectList, String unitString)
buttonTitle
- of the button.dialogTitle
- of the dialog.labelList
- list of labels to display in the object selector.objectList
- list of objects associated with the labels.unitString
- string of the unit to be displayed along with the object, null if no unit
is to be displayed.public GObjectSelector(String widgetId, String buttonTitle, String dialogTitle, String[] labelList, T[] objectList, String unitString)
widgetId
- widget identifier.buttonTitle
- of the button.dialogTitle
- of the dialog.labelList
- list of labels to display in the object selector.objectList
- list of objects associated with the labels.unitString
- string of the unit to be displayed along with the object, null if no unit
is to be displayed.public void setConstraint(GConstraint constraint)
setConstraint
in class GComponent
constraint
- constraint to set for the component.public GConstraint getConstraint()
getConstraint
in class GComponent
public T getObject()
protected abstract String getObjectValue(int comboboxValue)
comboboxValue
- selected in the selector combobox.public void setEnabled(boolean flag)
setEnabled
in class GComponent
flag
- new enable status of the component.public boolean isEnabled()
isEnabled
in class GComponent
public 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.public void display() throws GException
display
in interface GDisplay
GException
- in case of problem while reading the value from file.public void generic() throws GException
generic
in class GContainer
GException
- In case of problem.public void setToolTipText(String text)
setToolTipText
in class GComponent
text
- the tooltip text for the entry's label.public void setDialogTooltip(String text)
text
- tooltip to display in the dialog label.public void setStringConstraint(String constraint)
setStringConstraint
in class GComponent
constraint
- constraint in string format to set for 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.Copyright © 2024. All rights reserved.