public class GTextField extends GComponent implements GDisplay, GListener, ActionListener, FocusListener, KeyListener
| Modifier and Type | Class and Description |
|---|---|
class |
GTextField.GDocumentFieldFilterAbstract
Abstract class to handle the common functions of the DocumentFilter class.
|
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.OperationNAME_ATTRIBUTE| Constructor and Description |
|---|
GTextField(String textValue)
Default constructor.
|
GTextField(String widgetId,
String textValue)
Constructor with default document filter.
|
GTextField(String widgetId,
String textValue,
GDocumentFilterAbstract documentFilter)
Constructor with default document filter.
|
| 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.
|
protected int |
computeDefaultWidth(char character,
int numChars)
Compute the default with of the field based in the size of the font.
|
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 |
focusGained(FocusEvent e) |
void |
focusLost(FocusEvent e) |
protected int |
getCharWidth(char character)
Get the width in pixels of the character using the field default font.
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
JTextField |
getJTextField()
Returns the Swing widget.
|
String |
getText()
Get the current text contained in the widget.
|
void |
keyPressed(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent ev) |
void |
setDocumentFilter(GDocumentFilterAbstract documentFilter)
Set the document filter that will be used to validate the input.
|
void |
setEnabled(boolean flag)
Set the enable status of the component.
|
void |
setText(String textValue)
Sets the test for the widget.
|
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, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItempublic GTextField(String textValue)
textValue - initial value of the field.public GTextField(String widgetId, String textValue)
widgetId - identifier of the widget.textValue - initial value of the field.public GTextField(String widgetId, String textValue, GDocumentFilterAbstract documentFilter)
widgetId - identifier of the widget.textValue - initial value of the field.documentFilter - used to filter the valid inputs.protected int computeDefaultWidth(char character,
int numChars)
character - to compute the width.numChars - number of characters to compute the width.protected int getCharWidth(char character)
character - to compute the width.public void setEnabled(boolean flag)
setEnabled in class GComponentflag - new enable status of the component.public void display()
public void keyTyped(KeyEvent ev)
keyTyped in interface KeyListenerpublic void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic void focusGained(FocusEvent e)
focusGained in interface FocusListenerpublic void focusLost(FocusEvent e)
focusLost in interface FocusListenerpublic Component getComponent()
getComponent in class GComponentpublic JTextField getJTextField()
public void setText(String textValue)
textValue - value of the text.public String getText()
public void setDocumentFilter(GDocumentFilterAbstract documentFilter)
documentFilter - the document filter that will be used to validate the input.public void before(GEvent e) throws GException
before in interface GListenere - event to processed.GException - in case there is a problem managing the event.public void after(GEvent e) throws GException
after in interface GListenere - processed event.GException - in case there is a problem managing the event.Copyright © 2024. All rights reserved.