NextApp Echo
1.0.5

nextapp.echo.text
Class TextComponent

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.text.TextComponent
All Implemented Interfaces:
java.io.Serializable, ToolTipSupport
Direct Known Subclasses:
TextArea, TextField

public abstract class TextComponent
extends Component
implements ToolTipSupport

An abstract Text component whose data is represented in a document model.

See Also:
Serialized Form

Field Summary
static java.lang.String BORDER_COLOR_CHANGED_PROPERTY
           
static int BORDER_DEFAULT
          A border style that causes the client to render the text component with its default style.
static int BORDER_INSET
          A border style that causes a simulated 3D border to be rendered, such that the text component appears recessed.
static int BORDER_NONE
          A border style that causes no border to be rendered.
static java.lang.String BORDER_SIZE_CHANGED_PROPERTY
           
static int BORDER_SOLID
          A border style that causes a solid, monochrome border to be rendered in in the specified color.
static java.lang.String BORDER_STYLE_CHANGED_PROPERTY
           
static int CHARACTER_UNITS
           
static java.lang.String DOCUMENT_CHANGED_PROPERTY
           
static java.lang.String EDITABLE_CHANGED_PROPERTY
           
static java.lang.String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY
           
static int PERCENT_UNITS
           
static int PIXEL_UNITS
           
static java.lang.String STYLE_BORDER_COLOR
          A style constant for the Border Color property.
static java.lang.String STYLE_BORDER_SIZE
          A style constant for the Border Size property.
static java.lang.String STYLE_BORDER_STYLE
          A style constant for the Border Style property.
static java.lang.String STYLE_COLUMNS
          A style constant for the Columns property.
static java.lang.String STYLE_HORIZONTAL_ALIGNMENT
          A style constant for the Horizontal Alignment property.
static java.lang.String STYLE_LINE_WRAP
          A style constant for the Line Wrap property.
static java.lang.String STYLE_ROWS
          A style constant for the Rows property.
static java.lang.String TEXT_CHANGED_PROPERTY
           
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface nextapp.echo.ToolTipSupport
TOOL_TIP_TEXT_CHANGED_PROPERTY
 
Constructor Summary
TextComponent()
           
 
Method Summary
 void applyStyle(Style style)
          Sets stylistic properties of this component based on a Style object.
 Color getBorderColor()
          Returns the border color.
 int getBorderSize()
          Returns the border size.
 int getBorderStyle()
          Returns the border style.
 Document getDocument()
          Returns the document model.
 int getHorizontalAlignment()
          Returns the horizontal alignment of the text.
 java.lang.String getText()
          Returns the text contained in the document model.
 java.lang.String getToolTipText()
          Returns the default tool tip text.
 boolean isEditable()
          Returns whether the text component's is editable.
 void setBorderColor(Color newValue)
          Sets the border color.
 void setBorderSize(int newValue)
          Sets the border size.
 void setBorderStyle(int newValue)
          Sets the border style.
 void setDocument(Document newValue)
          Sets the document model.
 void setEditable(boolean newValue)
          Sets whether the text component is editable.
 void setHorizontalAlignment(int newValue)
          Sets the horizontal alignment of the text.
 void setText(java.lang.String newValue)
          Sets the text contained in the document model.
 void setToolTipText(java.lang.String newValue)
          Sets the default tool tip text.
 
Methods inherited from class nextapp.echo.Component
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_BORDER_COLOR

public static final java.lang.String STYLE_BORDER_COLOR
A style constant for the Border Color property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_BORDER_SIZE

public static final java.lang.String STYLE_BORDER_SIZE
A style constant for the Border Size property. Values of this key must be of type java.lang.Integer.

See Also:
Constant Field Values

STYLE_BORDER_STYLE

public static final java.lang.String STYLE_BORDER_STYLE
A style constant for the Border Style property. Values of this key must be of type java.lang.Integer.

See Also:
Constant Field Values

STYLE_COLUMNS

public static final java.lang.String STYLE_COLUMNS
A style constant for the Columns property. Values of this key must be of type java.lang.Integer.

See Also:
Constant Field Values

STYLE_HORIZONTAL_ALIGNMENT

public static final java.lang.String STYLE_HORIZONTAL_ALIGNMENT
A style constant for the Horizontal Alignment property. Values of this key must be of type java.lang.Integer.

See Also:
Constant Field Values

STYLE_ROWS

public static final java.lang.String STYLE_ROWS
A style constant for the Rows property. Values of this key must be of type java.lang.Integer.

See Also:
Constant Field Values

CHARACTER_UNITS

public static final int CHARACTER_UNITS
See Also:
Constant Field Values

PIXEL_UNITS

public static final int PIXEL_UNITS
See Also:
Constant Field Values

PERCENT_UNITS

public static final int PERCENT_UNITS
See Also:
Constant Field Values

STYLE_LINE_WRAP

public static final java.lang.String STYLE_LINE_WRAP
A style constant for the Line Wrap property. Values of this key must be of type java.lang.Boolean.

See Also:
Constant Field Values

BORDER_COLOR_CHANGED_PROPERTY

public static final java.lang.String BORDER_COLOR_CHANGED_PROPERTY
See Also:
Constant Field Values

BORDER_SIZE_CHANGED_PROPERTY

public static final java.lang.String BORDER_SIZE_CHANGED_PROPERTY
See Also:
Constant Field Values

BORDER_STYLE_CHANGED_PROPERTY

public static final java.lang.String BORDER_STYLE_CHANGED_PROPERTY
See Also:
Constant Field Values

DOCUMENT_CHANGED_PROPERTY

public static final java.lang.String DOCUMENT_CHANGED_PROPERTY
See Also:
Constant Field Values

EDITABLE_CHANGED_PROPERTY

public static final java.lang.String EDITABLE_CHANGED_PROPERTY
See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY

public static final java.lang.String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY
See Also:
Constant Field Values

TEXT_CHANGED_PROPERTY

public static final java.lang.String TEXT_CHANGED_PROPERTY
See Also:
Constant Field Values

BORDER_DEFAULT

public static final int BORDER_DEFAULT
A border style that causes the client to render the text component with its default style.

See Also:
Constant Field Values

BORDER_NONE

public static final int BORDER_NONE
A border style that causes no border to be rendered.

See Also:
Constant Field Values

BORDER_SOLID

public static final int BORDER_SOLID
A border style that causes a solid, monochrome border to be rendered in in the specified color.

See Also:
Constant Field Values

BORDER_INSET

public static final int BORDER_INSET
A border style that causes a simulated 3D border to be rendered, such that the text component appears recessed.

See Also:
Constant Field Values
Constructor Detail

TextComponent

public TextComponent()
Method Detail

applyStyle

public void applyStyle(Style style)
Description copied from class: Component
Sets stylistic properties of this component based on a Style object. The version of this method in Component will set foreground and background colors and the font from the style if they are present. Components should override this method if they allow more properties to be set from a style object, and should call super.applyStyle() if necessary.

Overrides:
applyStyle in class Component
Parameters:
style - The style object from which to retrieve properties for this Component.
See Also:
Component.applyStyle(Style)

getBorderColor

public Color getBorderColor()
Returns the border color.

Returns:
The border color.

getBorderSize

public int getBorderSize()
Returns the border size.

Returns:
The border size, in pixels.

getBorderStyle

public int getBorderStyle()
Returns the border style.

Returns:
The border style, one of the following values:
  • BORDER_DEFAULT - The client's default style (the default).
  • BORDER_SOLID - A solid single color border.
  • BORDER_INSET - A recessed 3D appearance.

getDocument

public Document getDocument()
Returns the document model.

Returns:
The document model.

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment of the text.

Returns:
The horizontal alignment of the text, one of the following values:
  • EchoConstants.LEFT (the default)
  • EchoConstants.CENTER
  • EchoConstants.RIGHT

getText

public java.lang.String getText()
Returns the text contained in the document model. If this text component's document model is null, throws a NullPointerException.

Returns:
The text contained in the document model.

getToolTipText

public java.lang.String getToolTipText()
Description copied from interface: ToolTipSupport
Returns the default tool tip text.

Specified by:
getToolTipText in interface ToolTipSupport
Returns:
The tool tip text.
See Also:
ToolTipSupport.getToolTipText()

isEditable

public boolean isEditable()
Returns whether the text component's is editable.

Returns:
True if the text component is editable.

setBorderColor

public void setBorderColor(Color newValue)
Sets the border color.

Parameters:
newValue - The new border color.

setBorderSize

public void setBorderSize(int newValue)
Sets the border size.

Parameters:
newValue - The new border size, in pixels.

setBorderStyle

public void setBorderStyle(int newValue)
Sets the border style.

Parameters:
newValue - The new border style, one of the following values:
  • BORDER_DEFAULT - The client's default style (the default).
  • BORDER_SOLID - A solid single color border.
  • BORDER_INSET - A recessed 3D appearance.

setDocument

public void setDocument(Document newValue)
Sets the document model.

Parameters:
newValue - The new document model.

setEditable

public void setEditable(boolean newValue)
Sets whether the text component is editable.

Parameters:
newValue - True if the text component's value may be changed.

setHorizontalAlignment

public void setHorizontalAlignment(int newValue)
Sets the horizontal alignment of the text.

Parameters:
newValue - The horizontal alignment of the text, one of the following values:
  • EchoConstants.LEFT (the default)
  • EchoConstants.CENTER
  • EchoConstants.RIGHT

setText

public void setText(java.lang.String newValue)
Sets the text contained in the document model. If this text component's document model is null, throws a NullPointerException.

Parameters:
newValue - The text to replace the text in the document model.

setToolTipText

public void setToolTipText(java.lang.String newValue)
Description copied from interface: ToolTipSupport
Sets the default tool tip text.

Specified by:
setToolTipText in interface ToolTipSupport
Parameters:
newValue - The new tool tip text.
See Also:
ToolTipSupport.setToolTipText(String)

NextApp Echo
1.0.5