EchoPoint
1.0

echopoint
Class RichTextArea

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.text.TextComponent
          extended byechopoint.RichTextArea
All Implemented Interfaces:
ReflectionSetter, java.io.Serializable, nextapp.echo.ToolTipSupport

public class RichTextArea
extends nextapp.echo.text.TextComponent
implements ReflectionSetter

The RichTextArea component provides HTML rich text editing facilities.

The actual commands support be the RichTextArea are defined via the RichTextRenderer interface.

See Also:
For more information about specific client capabilities, DefaultRichTextRenderer, Serialized Form

Nested Class Summary
static class RichTextArea.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static SymbolicValue[] allowableUnits
          Helper static SymbolicValue[] - Width/Height Units
static int DEFAULT_HEIGHT
          the default RichTextArea height
static int DEFAULT_HEIGHT_UNITS
          the default RichTextArea height units (pixels)
static nextapp.echo.Color DEFAULT_TOOLBAR_BACKGROUND
          the default RichTextArea width units (pixels)
static int DEFAULT_WIDTH
          the default RichTextArea width
static int DEFAULT_WIDTH_UNITS
          the default RichTextArea width units (pixels)
static java.lang.String HEIGHT_CHANGED_PROPERTY
           
static java.lang.String HEIGHT_UNITS_CHANGED_PROPERTY
           
static java.lang.String RENDERER_CHANGED_PROPERTY
           
static java.lang.String STYLE_HEIGHT
          A style constant for the Height property.
static java.lang.String STYLE_HEIGHT_UNITS
          A style constant for the Height Units property.
static java.lang.String STYLE_TOOLBAR_ALIGNMENT
          A style constant for the ToolBar Alignment property.
static java.lang.String STYLE_TOOLBAR_BACKGROUND
          A style constant for the ToolBar Background property.
static java.lang.String STYLE_WIDTH
          A style constant for the Width property.
static java.lang.String STYLE_WIDTH_UNITS
          A style constant for the Width Units property.
static java.lang.String TOOLBAR_ALIGNMENT_CHANGED_PROPERTY
           
static java.lang.String TOOLBAR_BACKGROUND_CHANGED_PROPERTY
           
static SymbolicValue[] toolBarSymbolics
          Helper static SymbolicValue[] - ToolBar Alignment
static java.lang.String WIDTH_CHANGED_PROPERTY
           
static java.lang.String WIDTH_UNITS_CHANGED_PROPERTY
           
 
Fields inherited from class nextapp.echo.text.TextComponent
BORDER_COLOR_CHANGED_PROPERTY, BORDER_DEFAULT, BORDER_INSET, BORDER_NONE, BORDER_SIZE_CHANGED_PROPERTY, BORDER_SOLID, BORDER_STYLE_CHANGED_PROPERTY, CHARACTER_UNITS, DOCUMENT_CHANGED_PROPERTY, EDITABLE_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, PERCENT_UNITS, PIXEL_UNITS, STYLE_BORDER_COLOR, STYLE_BORDER_SIZE, STYLE_BORDER_STYLE, STYLE_COLUMNS, STYLE_HORIZONTAL_ALIGNMENT, STYLE_LINE_WRAP, STYLE_ROWS, 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
RichTextArea()
          Constructs a RichTextArea with the default size.
RichTextArea(nextapp.echo.text.Document document)
          Constructs a new RichTextArea with the given text and default size.
RichTextArea(nextapp.echo.text.Document document, java.lang.String text, int width, int height)
          Creates a new RichTextArea with the given text and size.
RichTextArea(int width, int height)
          Creates a new RichTextArea of the given size.
RichTextArea(java.lang.String text)
          Creates a new RichTextArea with the given text.
RichTextArea(java.lang.String text, int width, int height)
          Creates a new RichTextArea with the given text and size.
 
Method Summary
 void applyStyle(nextapp.echo.Style style)
           
 int getHeight()
          Returns the height of the RichTextArea editing area.
 int getHeightUnits()
          Returns the units (pixel or percent) in which heights are measured.
 RichTextRenderer getRenderer()
          Returns the RichTextRenderer in use
 int getToolBarAlignment()
          Returns the toolbar alignment of the contents of this RichTextArea.
 nextapp.echo.Color getToolBarBackground()
          Returns the tollbar background color
 int getWidth()
          Returns the overall width of the RichTextArea.
 int getWidthUnits()
          Returns the units (pixel or percent) in which widths are measured.
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setHeight(int newValue)
          Sets the height of the RichTextArea editing area.
 void setHeightUnits(int newValue)
          Sets the units (pixel or percent) in which heights are measured.
 void setRenderer(RichTextRenderer renderer)
          Sets the RichTextRenderer to be used
 void setToolBarAlignment(int newValue)
          Sets the toolbar alignment of the contents of this RichTextArea.
 void setToolBarBackground(nextapp.echo.Color newValue)
          Sets the toolbar background color
 void setWidth(int newValue)
          Sets the overall width of the RichTextArea.
 void setWidthUnits(int newValue)
          Sets the units (pixel or percent) in which widths are measured.
 
Methods inherited from class nextapp.echo.text.TextComponent
getBorderColor, getBorderSize, getBorderStyle, getDocument, getHorizontalAlignment, getText, getToolTipText, isEditable, setBorderColor, setBorderSize, setBorderStyle, setDocument, setEditable, setHorizontalAlignment, setText, setToolTipText
 
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

allowableUnits

public static SymbolicValue[] allowableUnits
Helper static SymbolicValue[] - Width/Height Units


toolBarSymbolics

public static SymbolicValue[] toolBarSymbolics
Helper static SymbolicValue[] - ToolBar Alignment


DEFAULT_HEIGHT

public static final int DEFAULT_HEIGHT
the default RichTextArea height

See Also:
Constant Field Values

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
the default RichTextArea width

See Also:
Constant Field Values

DEFAULT_HEIGHT_UNITS

public static final int DEFAULT_HEIGHT_UNITS
the default RichTextArea height units (pixels)

See Also:
Constant Field Values

DEFAULT_WIDTH_UNITS

public static final int DEFAULT_WIDTH_UNITS
the default RichTextArea width units (pixels)

See Also:
Constant Field Values

DEFAULT_TOOLBAR_BACKGROUND

public static final nextapp.echo.Color DEFAULT_TOOLBAR_BACKGROUND
the default RichTextArea width units (pixels)


STYLE_HEIGHT

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

See Also:
Constant Field Values

STYLE_HEIGHT_UNITS

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

See Also:
Constant Field Values

STYLE_TOOLBAR_ALIGNMENT

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

See Also:
Constant Field Values

STYLE_TOOLBAR_BACKGROUND

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

See Also:
Constant Field Values

STYLE_WIDTH

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

See Also:
Constant Field Values

STYLE_WIDTH_UNITS

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

See Also:
Constant Field Values

HEIGHT_CHANGED_PROPERTY

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

HEIGHT_UNITS_CHANGED_PROPERTY

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

TOOLBAR_ALIGNMENT_CHANGED_PROPERTY

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

TOOLBAR_BACKGROUND_CHANGED_PROPERTY

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

WIDTH_CHANGED_PROPERTY

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

WIDTH_UNITS_CHANGED_PROPERTY

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

RENDERER_CHANGED_PROPERTY

public static final java.lang.String RENDERER_CHANGED_PROPERTY
See Also:
Constant Field Values
Constructor Detail

RichTextArea

public RichTextArea()
Constructs a RichTextArea with the default size.


RichTextArea

public RichTextArea(nextapp.echo.text.Document document)
Constructs a new RichTextArea with the given text and default size.

Parameters:
document - The model for this text field.

RichTextArea

public RichTextArea(nextapp.echo.text.Document document,
                    java.lang.String text,
                    int width,
                    int height)
Creates a new RichTextArea with the given text and size.

Parameters:
document - The model for this text field.
text - The initial text in the text field.
width - The width to display.
height - The height to display.

RichTextArea

public RichTextArea(int width,
                    int height)
Creates a new RichTextArea of the given size.

Parameters:
width - The width to display.
height - The height to display.

RichTextArea

public RichTextArea(java.lang.String text)
Creates a new RichTextArea with the given text.

Parameters:
text - The initial text in the text field.

RichTextArea

public RichTextArea(java.lang.String text,
                    int width,
                    int height)
Creates a new RichTextArea with the given text and size.

Parameters:
text - The initial text in the text field.
width - The width to display.
height - The height to display.
Method Detail

applyStyle

public void applyStyle(nextapp.echo.Style style)
See Also:
TextComponent.applyStyle(nextapp.echo.Style)

getHeight

public int getHeight()
Returns the height of the RichTextArea editing area.

This does not include the toolbar area of the RichTextArea, which can vary in height because of the fonts and images used.

Returns:
The height of the RichTextArea.

getHeightUnits

public int getHeightUnits()
Returns the units (pixel or percent) in which heights are measured.

Returns:
The unit measurement, one of the following values:
  • PIXEL_UNITS (the default)
  • PERCENT_UNITS

getToolBarAlignment

public int getToolBarAlignment()
Returns the toolbar alignment of the contents of this RichTextArea.

Returns:
The toolbar alignment of the contents of this RichTextArea, one of the following values:
  • EchoConstants.TOP (the default)
  • EchoConstants.BOTTOM

getToolBarBackground

public nextapp.echo.Color getToolBarBackground()
Returns the tollbar background color

Returns:
the tollbar background color

getWidth

public int getWidth()
Returns the overall width of the RichTextArea.

Returns:
The width of the RichTextArea.

getWidthUnits

public int getWidthUnits()
Returns the units (pixel or percent) in which widths are measured.

Returns:
The unit measurement, one of the following values:
  • PIXEL_UNITS (the default)
  • PERCENT_UNITS

setHeight

public void setHeight(int newValue)
Sets the height of the RichTextArea editing area.

This does not include the toolbar area of the RichTextArea, which can vary in height because of the fonts and images used.

Parameters:
newValue - The new height of the RichTextArea.

setHeightUnits

public void setHeightUnits(int newValue)
Sets the units (pixel or percent) in which heights are measured.

Parameters:
newValue - The new unit measurement, one of the following values:
  • PIXEL_UNITS (the default)
  • PERCENT_UNITS

setToolBarAlignment

public void setToolBarAlignment(int newValue)
Sets the toolbar alignment of the contents of this RichTextArea.

Parameters:
newValue - The toolbar alignment of the contents of this RichTextArea, one of the following values.
  • EchoConstants.TOP (the default)
  • EchoConstants.BOTTOM

setToolBarBackground

public void setToolBarBackground(nextapp.echo.Color newValue)
Sets the toolbar background color

Parameters:
newValue - - the new toolbar background color

setWidth

public void setWidth(int newValue)
Sets the overall width of the RichTextArea.

Parameters:
newValue - The new width of the RichTextArea.

setWidthUnits

public void setWidthUnits(int newValue)
Sets the units (pixel or percent) in which widths are measured.

Parameters:
newValue - The new unit measurement, one of the following values:
  • PIXEL_UNITS
  • PERCENT_UNITS (the default)

getRenderer

public RichTextRenderer getRenderer()
Returns the RichTextRenderer in use

Returns:
the RichTextRenderer in use

setRenderer

public void setRenderer(RichTextRenderer renderer)
Sets the RichTextRenderer to be used

Parameters:
renderer - - the new RichTextRenderer to be used

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Parameters:
field - - the field to be set
newValue - - the new value to be set
Returns:
the oldValue of the field
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0