Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.app.text
Class TextComponent

    java.lang.Object
      nextapp.echo2.app.Component
          nextapp.echo2.app.text.TextComponent

All Implemented Interfaces:
  java.io.Serializable, RenderIdSupport

Direct Known Subclasses:
  RichTextArea, TextArea, TextField

    public abstract class TextComponent

extends Component

Abstract base class for text-entry components.

See Also:
  Serialized Form

Field Summary
`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_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_TOOL_TIP_TEXT`
`static java.lang.String` | `PROPERTY_VERTICAL_SCROLL`
`static java.lang.String` | `PROPERTY_WIDTH`
`static java.lang.String` | `TEXT_CHANGED_PROPERTY`

Fields inherited from class nextapp.echo2.app.Component
`CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_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 Summary
`TextComponent(Document document)` Creates a new `TextComponent` with the specified `Document` as its model.

Method Summary
`void` | `addActionListener(ActionListener l)` Adds an `ActionListener` to the `TextField`.
`java.lang.String` | `getActionCommand()` Returns the action command which will be provided in `ActionEvent`s fired by this `TextField`.
`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.
`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 the any `ActionListener`s are registered.
`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 `TextField`.
`void` | `setActionCommand(java.lang.String newValue)` Sets the action command which will be provided in `ActionEvent`s fired by this `TextField`.
`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` | `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` | `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.

Methods inherited from class nextapp.echo2.app.Component
`add, add, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### INPUT_ACTION

    public static final java.lang.String INPUT_ACTION

See Also:
  Constant Field Values

### PROPERTY_ACTION_COMMAND

    public static final java.lang.String PROPERTY_ACTION_COMMAND

See Also:
  Constant Field Values

### PROPERTY_ALIGNMENT

    public static final java.lang.String PROPERTY_ALIGNMENT

See Also:
  Constant Field Values

### PROPERTY_BACKGROUND_IMAGE

    public static final java.lang.String PROPERTY_BACKGROUND_IMAGE

See Also:
  Constant Field Values

### PROPERTY_BORDER

    public static final java.lang.String PROPERTY_BORDER

See Also:
  Constant Field Values

### PROPERTY_DISABLED_BACKGROUND

    public static final java.lang.String PROPERTY_DISABLED_BACKGROUND

See Also:
  Constant Field Values

### PROPERTY_DISABLED_BACKGROUND_IMAGE

    public static final java.lang.String PROPERTY_DISABLED_BACKGROUND_IMAGE

See Also:
  Constant Field Values

### PROPERTY_DISABLED_BORDER

    public static final java.lang.String PROPERTY_DISABLED_BORDER

See Also:
  Constant Field Values

### PROPERTY_DISABLED_FONT

    public static final java.lang.String PROPERTY_DISABLED_FONT

See Also:
  Constant Field Values

### PROPERTY_DISABLED_FOREGROUND

    public static final java.lang.String PROPERTY_DISABLED_FOREGROUND

See Also:
  Constant Field Values

### PROPERTY_HEIGHT

    public static final java.lang.String PROPERTY_HEIGHT

See Also:
  Constant Field Values

### PROPERTY_HORIZONTAL_SCROLL

    public static final java.lang.String PROPERTY_HORIZONTAL_SCROLL

See Also:
  Constant Field Values

### PROPERTY_INSETS

    public static final java.lang.String PROPERTY_INSETS

See Also:
  Constant Field Values

### PROPERTY_MAXIMUM_LENGTH

    public static final java.lang.String PROPERTY_MAXIMUM_LENGTH

See Also:
  Constant Field Values

### PROPERTY_TOOL_TIP_TEXT

    public static final java.lang.String PROPERTY_TOOL_TIP_TEXT

See Also:
  Constant Field Values

### PROPERTY_VERTICAL_SCROLL

    public static final java.lang.String PROPERTY_VERTICAL_SCROLL

See Also:
  Constant Field Values

### PROPERTY_WIDTH

    public static final java.lang.String PROPERTY_WIDTH

See Also:
  Constant Field Values

### ACTION_LISTENERS_CHANGED_PROPERTY

    public static final java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY

See Also:
  Constant Field Values

### DOCUMENT_CHANGED_PROPERTY

    public static final java.lang.String DOCUMENT_CHANGED_PROPERTY

See Also:
  Constant Field Values

### TEXT_CHANGED_PROPERTY

    public static final java.lang.String TEXT_CHANGED_PROPERTY

See Also:
  Constant Field Values

Constructor Detail

### TextComponent

    public TextComponent(Document document)

  Creates a new `TextComponent` with the specified `Document` as its model.

  Parameters:
    `document` - the desired model

Method Detail

### addActionListener

    public void addActionListener(ActionListener l)

  Adds an `ActionListener` to the `TextField`. The `ActionListener` will be invoked when the user presses the ENTER key in the field.

  Parameters:
    `l` - the `ActionListener` to add

### getActionCommand

    public java.lang.String getActionCommand()

  Returns the action command which will be provided in `ActionEvent`s fired by this `TextField`.

  Returns:
    the action command

### getAlignment

    public Alignment getAlignment()

  Returns the alignment of the text component.

  Returns:
    the alignment

### getBackgroundImage

    public FillImage getBackgroundImage()

  Returns the default background image of the text component.

  Returns:
    the background image

### getBorder

    public Border getBorder()

  Returns the border of the text component.

  Returns:
    the border

### getDisabledBackground

    public Color getDisabledBackground()

  Returns the background color displayed when the text component is disabled.

  Returns:
    the color

### getDisabledBackgroundImage

    public FillImage getDisabledBackgroundImage()

  Returns the background image displayed when the text component is disabled.

  Returns:
    the background image

### getDisabledBorder

    public Border getDisabledBorder()

  Returns the border displayed when the text component is disabled.

  Returns:
    the border

### getDisabledFont

    public Font getDisabledFont()

  Returns the font displayed when the text component is disabled.

  Returns:
    the font

### getDisabledForeground

    public Color getDisabledForeground()

  Returns the foreground color displayed when the text component is disabled.

  Returns:
    the color

### getDocument

    public Document getDocument()

  Returns the model associated with this `TextComponent`.

  Returns:
    the model

### getHeight

    public Extent getHeight()

  Returns the height of the text component. This property only supports `Extent`s with fixed (i.e., not percent) units.

  Returns:
    the height

### getHorizontalScroll

    public Extent getHorizontalScroll()

  Returns the horizontal scroll bar position.

  Returns:
    the scroll bar position

### getInsets

    public Insets getInsets()

  Returns the insets of the text component.

  Returns:
    the insets

### getMaximumLength

    public int getMaximumLength()

  Returns the maximum length (in characters) of the text which may be entered into the component.

  Returns:
    the maximum length, or -1 if no value is specified

### getText

    public java.lang.String getText()

  Returns the text contained in the `Document` model of this text component.

  Returns:
    the text contained in the document

### getToolTipText

    public java.lang.String getToolTipText()

  Returns the tool tip text (displayed when the mouse cursor is hovered over the component).

  Returns:
    the tool tip text

### getVerticalScroll

    public Extent getVerticalScroll()

  Returns the vertical scroll bar position.

  Returns:
    the scroll bar position

### getWidth

    public Extent getWidth()

  Returns the width of the text component. This property supports `Extent`s with either fixed or percentage-based units.

  Returns:
    the width

### hasActionListeners

    public boolean hasActionListeners()

  Determines the any `ActionListener`s are registered.

  Returns:
    true if any action listeners are registered

### isValidChild

    public boolean isValidChild(Component component)

  This component does not support children.

  Overrides:
    `isValidChild` in class `Component`
  Parameters:
    `component` - the `Component` to evaluate as a child
  Returns:
    true if the `Component` is a valid child
  See Also:
    `Component.isValidChild(nextapp.echo2.app.Component)`

### processInput

    public void processInput(java.lang.String inputName,
                             java.lang.Object inputValue)

  Description copied from class: `Component`
  Processes client input specific to the `Component` received from the `UpdateManager`. Derivative implementations should take care to invoke `super.processInput()`.

  Overrides:
    `processInput` in class `Component`
  Parameters:
    `inputName` - the name of the input
    `inputValue` - the value of the input
  See Also:
    `Component.processInput(java.lang.String, java.lang.Object)`

### removeActionListener

    public void removeActionListener(ActionListener l)

  Removes an `ActionListener` from the `TextField`.

  Parameters:
    `l` - the `ActionListener` to remove

### setActionCommand

    public void setActionCommand(java.lang.String newValue)

  Sets the action command which will be provided in `ActionEvent`s fired by this `TextField`.

  Parameters:
    `newValue` - the new action command

### setAlignment

    public void setAlignment(Alignment newValue)

  Sets the alignment of the text component.

  Parameters:
    `newValue` - the new alignment

### setBackgroundImage

    public void setBackgroundImage(FillImage newValue)

  Sets the default background image of the text component.

  Parameters:
    `newValue` - the new background image

### setBorder

    public void setBorder(Border newValue)

  Sets the border of the text component.

  Parameters:
    `newValue` - the new border

### setDisabledBackground

    public void setDisabledBackground(Color newValue)

  Sets the background color displayed when the component is disabled.

  Parameters:
    `newValue` - the new `Color`

### setDisabledBackgroundImage

    public void setDisabledBackgroundImage(FillImage newValue)

  Sets the background image displayed when the component is disabled.

  Parameters:
    `newValue` - the new background image

### setDisabledBorder

    public void setDisabledBorder(Border newValue)

  Sets the border displayed when the component is disabled.

  Parameters:
    `newValue` - the new border

### setDisabledFont

    public void setDisabledFont(Font newValue)

  Sets the font displayed when the component is disabled.

  Parameters:
    `newValue` - the new `Font`

### setDisabledForeground

    public void setDisabledForeground(Color newValue)

  Sets the foreground color displayed when the component is disabled.

  Parameters:
    `newValue` - the new `Color`

### setDocument

    public void setDocument(Document newValue)

  Sets the model associated with this `TextComponent`.

  Parameters:
    `newValue` - the new model (may not be null)

### setHeight

    public void setHeight(Extent newValue)

  Sets the height of the text component. This property only supports `Extent`s with fixed (i.e., not percent) units.

  Parameters:
    `newValue` - the new height

### setHorizontalScroll

    public void setHorizontalScroll(Extent newValue)

  Sets the horizontal scroll bar position. The provided `Extent` value must be in pixel units.

  Parameters:
    `newValue` - the new scroll bar position

### setInsets

    public void setInsets(Insets newValue)

  Sets the insets of the text component.

  Parameters:
    `newValue` - the new insets

### setMaximumLength

    public void setMaximumLength(int newValue)

  Sets the maximum length (in characters) of the text which may be entered into the component.

  Parameters:
    `newValue` - the new maximum length, or -1 if to specify an unlimited length

### setText

    public void setText(java.lang.String newValue)

  Sets the text of document model of this text component.

  Parameters:
    `newValue` - the new text

### setToolTipText

    public void setToolTipText(java.lang.String newValue)

  Sets the tool tip text (displayed when the mouse cursor is hovered over the component).

  Parameters:
    `newValue` - the new tool tip text

### setVerticalScroll

    public void setVerticalScroll(Extent newValue)

  Sets the vertical scroll bar position. The provided `Extent` value must be in pixel units.

  Parameters:
    `newValue` - the new scroll bar position

### setWidth

    public void setWidth(Extent newValue)

  Sets the width of the text component. This property supports `Extent`s with either fixed or percentage-based units.

  Parameters:
    `newValue` - the new width

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD