public abstract class TextComponent extends Component
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTION_LISTENERS_CHANGED_PROPERTY |
static java.lang.String |
DOCUMENT_CHANGED_PROPERTY |
static java.lang.String |
INPUT_ACTION |
static java.lang.String |
PROPERTY_ACTION_COMMAND |
static java.lang.String |
PROPERTY_ALIGNMENT |
static java.lang.String |
PROPERTY_BACKGROUND_IMAGE |
static java.lang.String |
PROPERTY_BORDER |
static java.lang.String |
PROPERTY_DISABLED_BACKGROUND |
static java.lang.String |
PROPERTY_DISABLED_BACKGROUND_IMAGE |
static java.lang.String |
PROPERTY_DISABLED_BORDER |
static java.lang.String |
PROPERTY_DISABLED_FONT |
static java.lang.String |
PROPERTY_DISABLED_FOREGROUND |
static java.lang.String |
PROPERTY_EDITABLE |
static java.lang.String |
PROPERTY_HEIGHT |
static java.lang.String |
PROPERTY_HORIZONTAL_SCROLL |
static java.lang.String |
PROPERTY_INSETS |
static java.lang.String |
PROPERTY_MAXIMUM_LENGTH |
static java.lang.String |
PROPERTY_READONLY_BACKGROUND |
static java.lang.String |
PROPERTY_READONLY_BACKGROUND_IMAGE |
static java.lang.String |
PROPERTY_READONLY_BORDER |
static java.lang.String |
PROPERTY_READONLY_FONT |
static java.lang.String |
PROPERTY_READONLY_FOREGROUND |
static java.lang.String |
PROPERTY_TOOL_TIP_TEXT |
static java.lang.String |
PROPERTY_VERTICAL_SCROLL |
static java.lang.String |
PROPERTY_WIDTH |
static java.lang.String |
TEXT_CHANGED_PROPERTY |
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY| Constructor and Description |
|---|
TextComponent(Document document)
Creates a new
TextComponent with the specified
Document as its model. |
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(ActionListener l)
Adds an
ActionListener to the TextComponent. |
java.lang.String |
getActionCommand()
Returns the action command which will be provided in
ActionEvents fired by this TextComponent. |
Alignment |
getAlignment()
Returns the alignment of the text component.
|
FillImage |
getBackgroundImage()
Returns the default background image of the text component.
|
Border |
getBorder()
Returns the border of the text component.
|
Color |
getDisabledBackground()
Returns the background color displayed when the text component is
disabled.
|
FillImage |
getDisabledBackgroundImage()
Returns the background image displayed when the text component is
disabled.
|
Border |
getDisabledBorder()
Returns the border displayed when the text component is
disabled.
|
Font |
getDisabledFont()
Returns the font displayed when the text component is
disabled.
|
Color |
getDisabledForeground()
Returns the foreground color displayed when the text component is
disabled.
|
Document |
getDocument()
Returns the model associated with this
TextComponent. |
Extent |
getHeight()
Returns the height of the text component.
|
Extent |
getHorizontalScroll()
Returns the horizontal scroll bar position.
|
Insets |
getInsets()
Returns the insets of the text component.
|
int |
getMaximumLength()
Returns the maximum length (in characters) of the text which may be
entered into the component.
|
Color |
getReadOnlyBackground()
Returns the background color displayed when the text component is
read only.
|
FillImage |
getReadOnlyBackgroundImage()
Returns the background image displayed when the text component is
read only.
|
Border |
getReadOnlyBorder()
Returns the border displayed when the text component is
read only.
|
Font |
getReadOnlyFont()
Returns the font displayed when the text component is
read only.
|
Color |
getReadOnlyForeground()
Returns the foreground color displayed when the text component is
read only.
|
java.lang.String |
getText()
Returns the text contained in the
Document model of
this text component. |
java.lang.String |
getToolTipText()
Returns the tool tip text (displayed when the mouse cursor is hovered
over the component).
|
Extent |
getVerticalScroll()
Returns the vertical scroll bar position.
|
Extent |
getWidth()
Returns the width of the text component.
|
boolean |
hasActionListeners()
Determines if any
ActionListeners are registered. |
boolean |
isEditable()
Determines the editable state of this component.
|
boolean |
isValidChild(Component component)
This component does not support children.
|
void |
processInput(java.lang.String inputName,
java.lang.Object inputValue)
Processes client input specific to the
Component
received from the UpdateManager. |
void |
removeActionListener(ActionListener l)
Removes an
ActionListener from the TextComponent. |
void |
setActionCommand(java.lang.String newValue)
Sets the action command which will be provided in
ActionEvents fired by this TextComponent. |
void |
setAlignment(Alignment newValue)
Sets the alignment of the text component.
|
void |
setBackgroundImage(FillImage newValue)
Sets the default background image of the text component.
|
void |
setBorder(Border newValue)
Sets the border of the text component.
|
void |
setDisabledBackground(Color newValue)
Sets the background color displayed when the component is disabled.
|
void |
setDisabledBackgroundImage(FillImage newValue)
Sets the background image displayed when the component is disabled.
|
void |
setDisabledBorder(Border newValue)
Sets the border displayed when the component is disabled.
|
void |
setDisabledFont(Font newValue)
Sets the font displayed when the component is disabled.
|
void |
setDisabledForeground(Color newValue)
Sets the foreground color displayed when the component is disabled.
|
void |
setDocument(Document newValue)
Sets the model associated with this
TextComponent. |
void |
setEditable(boolean newValue)
Sets the editable state of this component.
|
void |
setHeight(Extent newValue)
Sets the height of the text component.
|
void |
setHorizontalScroll(Extent newValue)
Sets the horizontal scroll bar position.
|
void |
setInsets(Insets newValue)
Sets the insets of the text component.
|
void |
setMaximumLength(int newValue)
Sets the maximum length (in characters) of the text which may be
entered into the component.
|
void |
setReadOnlyBackground(Color newValue)
Sets the background color displayed when the component is read only.
|
void |
setReadOnlyBackgroundImage(FillImage newValue)
Sets the background image displayed when the component is read only.
|
void |
setReadOnlyBorder(Border newValue)
Sets the border displayed when the component is read only.
|
void |
setReadOnlyFont(Font newValue)
Sets the font displayed when the component is read only.
|
void |
setReadOnlyForeground(Color newValue)
Sets the foreground color displayed when the component is read only.
|
void |
setText(java.lang.String newValue)
Sets the text of document model of this text component.
|
void |
setToolTipText(java.lang.String newValue)
Sets the tool tip text (displayed when the mouse cursor is hovered
over the component).
|
void |
setVerticalScroll(Extent newValue)
Sets the vertical scroll bar position.
|
void |
setWidth(Extent newValue)
Sets the width of the text component.
|
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOfpublic static final java.lang.String INPUT_ACTION
public static final java.lang.String PROPERTY_ACTION_COMMAND
public static final java.lang.String PROPERTY_ALIGNMENT
public static final java.lang.String PROPERTY_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_BORDER
public static final java.lang.String PROPERTY_DISABLED_BACKGROUND
public static final java.lang.String PROPERTY_DISABLED_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_DISABLED_BORDER
public static final java.lang.String PROPERTY_DISABLED_FONT
public static final java.lang.String PROPERTY_DISABLED_FOREGROUND
public static final java.lang.String PROPERTY_EDITABLE
public static final java.lang.String PROPERTY_HEIGHT
public static final java.lang.String PROPERTY_HORIZONTAL_SCROLL
public static final java.lang.String PROPERTY_INSETS
public static final java.lang.String PROPERTY_MAXIMUM_LENGTH
public static final java.lang.String PROPERTY_READONLY_BACKGROUND
public static final java.lang.String PROPERTY_READONLY_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_READONLY_BORDER
public static final java.lang.String PROPERTY_READONLY_FONT
public static final java.lang.String PROPERTY_READONLY_FOREGROUND
public static final java.lang.String PROPERTY_TOOL_TIP_TEXT
public static final java.lang.String PROPERTY_VERTICAL_SCROLL
public static final java.lang.String PROPERTY_WIDTH
public static final java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY
public static final java.lang.String DOCUMENT_CHANGED_PROPERTY
public static final java.lang.String TEXT_CHANGED_PROPERTY
public TextComponent(Document document)
TextComponent with the specified
Document as its model.document - the desired modelpublic void addActionListener(ActionListener l)
ActionListener to the TextComponent.
The ActionListener will be invoked when the user
presses the ENTER key in the field.l - the ActionListener to addpublic java.lang.String getActionCommand()
ActionEvents fired by this TextComponent.public Alignment getAlignment()
public FillImage getBackgroundImage()
public Border getBorder()
public Color getDisabledBackground()
public FillImage getDisabledBackgroundImage()
public Border getDisabledBorder()
public Font getDisabledFont()
public Color getDisabledForeground()
public Document getDocument()
TextComponent.public Extent getHeight()
Extents with
fixed (i.e., not percent) units.public Extent getHorizontalScroll()
public Insets getInsets()
public int getMaximumLength()
public Color getReadOnlyBackground()
public FillImage getReadOnlyBackgroundImage()
public Border getReadOnlyBorder()
public Font getReadOnlyFont()
public Color getReadOnlyForeground()
public java.lang.String getText()
Document model of
this text component.public java.lang.String getToolTipText()
public Extent getVerticalScroll()
public Extent getWidth()
Extents with
either fixed or percentage-based units.public boolean hasActionListeners()
ActionListeners are registered.public boolean isEditable()
true if this component is editablepublic boolean isValidChild(Component component)
isValidChild in class Componentcomponent - the Component to evaluate as a childComponent is a valid childComponent.isValidChild(nextapp.echo.app.Component)public void processInput(java.lang.String inputName,
java.lang.Object inputValue)
ComponentComponent
received from the UpdateManager.
Derivative implementations should take care to invoke
super.processInput().
Security note: Because input to this method is
likely from a remote client, it should be treated as potentially hostile.
All input to this method should be carefully verified.
For example, directly invoking set() method with the
provided input would constitute a security hole.processInput in class ComponentinputName - the name of the inputinputValue - the value of the inputComponent.processInput(java.lang.String, java.lang.Object)public void removeActionListener(ActionListener l)
ActionListener from the TextComponent.l - the ActionListener to removepublic void setActionCommand(java.lang.String newValue)
ActionEvents fired by this TextComponent.newValue - the new action commandpublic void setAlignment(Alignment newValue)
newValue - the new alignmentpublic void setBackgroundImage(FillImage newValue)
newValue - the new background imagepublic void setBorder(Border newValue)
newValue - the new borderpublic void setDisabledBackground(Color newValue)
newValue - the new Colorpublic void setDisabledBackgroundImage(FillImage newValue)
newValue - the new background imagepublic void setDisabledBorder(Border newValue)
newValue - the new borderpublic void setDisabledFont(Font newValue)
newValue - the new Fontpublic void setDisabledForeground(Color newValue)
newValue - the new Colorpublic void setDocument(Document newValue)
TextComponent.newValue - the new model (may not be null)public void setEditable(boolean newValue)
newValue - the new editable statepublic void setHeight(Extent newValue)
Extents with
fixed (i.e., not percent) units.newValue - the new heightpublic void setHorizontalScroll(Extent newValue)
Extent value must be in pixel units.newValue - the new scroll bar positionpublic void setInsets(Insets newValue)
newValue - the new insetspublic void setMaximumLength(int newValue)
newValue - the new maximum length, or -1 if to specify an
unlimited lengthpublic void setReadOnlyBackground(Color newValue)
newValue - the new Colorpublic void setReadOnlyBackgroundImage(FillImage newValue)
newValue - the new background imagepublic void setReadOnlyBorder(Border newValue)
newValue - the new borderpublic void setReadOnlyFont(Font newValue)
newValue - the new Fontpublic void setReadOnlyForeground(Color newValue)
newValue - the new Colorpublic void setText(java.lang.String newValue)
newValue - the new textpublic void setToolTipText(java.lang.String newValue)
newValue - the new tool tip textpublic void setVerticalScroll(Extent newValue)
Extent value must be in pixel units.newValue - the new scroll bar positionpublic void setWidth(Extent newValue)
Extents with
either fixed or percentage-based units.newValue - the new width