public abstract class GEntryNumberAbstract extends GContainer implements GDisplay, GClear
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GEntryNumberAbstract(String widgetId,
String label,
GNumberFieldAbstract field)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addGInterval(GIntervalAbstract interval)
Adds a validity interval to the field.
|
void |
attachCopyPasteMenu(String label,
GComponent.CopyPasteOperation... operationList)
Attach the copy and paste menu to this component.
|
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.
|
GNumberFieldAbstract |
getGField()
Get the m_textField as a GNumberFieldAbstract.
|
GIntervalAbstract |
getGInterval(int index)
Get the interval of a given index in the list.
|
GLabelWithIndicator |
getGLabelWithIndicator()
Get the m_label.
|
GTextField |
getGTextField()
Get the m_textField as a GTextField.
|
protected Number |
getNumber()
Get the value of the entry as a Number so it can be used for real and integer values.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
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.
|
void |
removeGInterval(GIntervalAbstract interval)
Remove a validity interval of the field.
|
protected void |
setDefaultConstraints()
Set default constraints.
|
void |
setEnabled(boolean b)
Set the enable status of the component.
|
void |
setShortcut(int shorcutKey)
Set the shortcut key for focusing the entryField.
|
void |
setStringConstraint(String constraints)
Set the constraint in string format for the component.
|
void |
setToolTipText(String text)
Set the tooltip text for the entry's label.
|
void |
setWidgetId(String widgetId)
Sets the widget identifier of the component.
|
void |
updateGInterval(GIntervalAbstract oldInterval,
GIntervalAbstract newInterval)
Update a validity interval of the field.
|
protected void |
updateIntervalMessage(GUnit currentUnit,
GIntervalFormatAbstract formatter)
Updates the interval message taking into account the current unit and message of the entry.
|
void |
updateStatus()
Update the status of the field applying the defined validity intervals.
|
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, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GEntryNumberAbstract(String widgetId, String label, GNumberFieldAbstract field)
widgetId
- widget identifier, if null an identifier will be automatically created.label
- text to display in the label.field
- to use to represent the value.protected void setDefaultConstraints()
GComponent
setDefaultConstraints
in class GComponent
public GComponent getSubComponent(int position) throws GComponentException
GComponent
getSubComponent
in class GComponent
position
- position of the requested component.GComponentException
- in case the position argument is invalid.public void setWidgetId(String widgetId)
setWidgetId
in class GComponent
widgetId
- the widget identifier of the component.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.protected Number getNumber()
public GNumberFieldAbstract getGField()
public GTextField getGTextField()
public GLabelWithIndicator getGLabelWithIndicator()
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 GComponent.CopyPasteOperation isCopyPasteEvent(GEvent event)
isCopyPasteEvent
in class GComponent
event
- to check.public boolean isEnabled()
isEnabled
in class GComponent
public void setEnabled(boolean b)
setEnabled
in class GComponent
b
- new enable status of the component.public void addGInterval(GIntervalAbstract interval) throws GIntervalException
interval
- to add.GIntervalException
- in case the interval overlaps with an existing one.public void updateGInterval(GIntervalAbstract oldInterval, GIntervalAbstract newInterval) throws GIntervalException
oldInterval
- to update.newInterval
- to update newInterval.GIntervalException
- in case oldInterval is not found in the list of intervals defined
for the field.protected void updateIntervalMessage(GUnit currentUnit, GIntervalFormatAbstract formatter)
currentUnit
- the current unit of the entry.formatter
- Necessary data to format the message (normal/scientific format and
fractional digits)public void removeGInterval(GIntervalAbstract interval)
interval
- to be removedpublic GIntervalAbstract getGInterval(int index)
index
- of the wanted interval in the intervals list.public void updateStatus()
public void setToolTipText(String text)
setToolTipText
in class GComponent
text
- the tooltip text for the entry's label.public void setShortcut(int shorcutKey)
shorcutKey
- the shortcut key to be attached to the widget.public void setStringConstraint(String constraints)
setStringConstraint
in class GComponent
constraints
- constraint in string format to set for the component.Copyright © 2024. All rights reserved.