public class GEntryString extends GContainer implements GDisplay, GReadWrite, GListener, GClear
GTextField
Object for character string input. It implements save and load of the value in the configuration
file.Index | Class | Item | Constraint |
0 | GLabelWithIndicator | label | 0, 0 => "newline , split 2" 0, 1 => (null) |
1 | GTextField | textField | (null) |
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GEntryString()
Constructor by default.
|
GEntryString(String label,
String value)
Constructor.
|
GEntryString(String widgetId,
String label,
String value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addGIntervalEmptyString(GIntervalEmptyString interval)
Adds a validity interval to the field.
|
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.
|
GLabelWithIndicator |
getGLabelWithIndicator()
Get the m_label.
|
GTextField |
getGTextField()
Get the m_textField.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
String |
getValue()
Return the value of the field.
|
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.
|
protected void |
setDefaultConstraints()
Set default constraints.
|
void |
setDefaultValue(String newDefaultValue)
Set default value.
|
void |
setEnabled(boolean b)
Set the enable status of the component.
|
void |
setSavedValue(String value)
Set the new saved value.
|
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 |
setValue(String value)
Set the value of the field.
|
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 field applying the defined validity intervals.
|
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, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setWidth, setWindowBusyCursor, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GEntryString()
public GEntryString(String label, String value)
label
- of the entry.value
- value of the entry.protected void setDefaultConstraints()
GComponent
setDefaultConstraints
in class GComponent
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 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.public boolean isEnabled()
isEnabled
in class GComponent
public void setEnabled(boolean b)
setEnabled
in class GComponent
b
- new enable status of the component.public String getValue()
public void setValue(String value)
value
- to set in the field.public void setSavedValue(String value)
value
- new saved value.public void read() throws GException
read
in interface GReadWrite
GException
- in case of problem while reading the value from file.public void write() throws GException
write
in interface GReadWrite
GException
- in case of problem while writing the value to file.public void addGIntervalEmptyString(GIntervalEmptyString interval) throws GIntervalException
interval
- to add.GIntervalException
- in case the interval overlap with the existing ones.public void updateStatus()
public boolean isModified()
isModified
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, GFileManipulatorException
after
in interface GListener
e
- processed event.GException
- in case there is a problem managing the event.GFileManipulatorException
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 GTextField getGTextField()
protected void updateIsModifiedIndicator()
updateIsModifiedIndicator
in class GComponent
public void clear() throws GException
GClear
clear
in interface GClear
GException
- in case of problem while clearing the values.public void setDefaultValue(String newDefaultValue)
newDefaultValue
- new default value.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 wigdet.public void setStringConstraint(String constraints)
setStringConstraint
in class GComponent
constraints
- constraint in string format to set for the component.Copyright © 2024. All rights reserved.