EchoPoint
1.0

echopoint.richtext
Class DefaultRichTextRenderer

java.lang.Object
  extended byechopoint.richtext.DefaultRichTextRenderer
All Implemented Interfaces:
RichTextRenderer, java.io.Serializable

public class DefaultRichTextRenderer
extends java.lang.Object
implements RichTextRenderer, java.io.Serializable

The DefaultRichTextRenderer is the default RichTextArea renderer.

Some notes on browser capabilities as of the 10 September 2003.

See Also:
Serialized Form

Field Summary
static nextapp.echo.Color[] DEFAULT_COLOR_CHOICES
          contains the default color choices
static java.lang.Object[][] DEFAULT_COMMAND_IMAGES
          contains a mapping of command (String) to image resources (ImageReference)
static java.lang.String[][] DEFAULT_FONT_NAMES
          contains the default font names to use
static java.lang.String[][] DEFAULT_FONT_SIZES
          contains the default font sizes to use
static java.lang.String[][] DEFAULT_PARAGRAPH_STYLES
          contains the default paragraph styles
static java.lang.String[][] DEFAULT_SUPPORTED_COMMANDS
          contains a mapping of supported commands (String) and descriptive titles (String)
static java.lang.String[][] EXTENDED_FONT_NAMES
          contains the extended font names that may be available for use
static java.lang.String[][] SIMPLE_FONT_NAMES
          contains the simple font names most likely to be available to use
 
Fields inherited from interface echopoint.richtext.RichTextRenderer
CMD_ALIGN_CENTER, CMD_ALIGN_LEFT, CMD_ALIGN_RIGHT, CMD_BACKCOLOR, CMD_BOLD, CMD_BULLETS, CMD_COPY, CMD_CREATELINK, CMD_CUT, CMD_FORECOLOR, CMD_HINT_NEWLINE, CMD_HINT_SPACER, CMD_INDENT, CMD_INSERTHR, CMD_INSERTIMAGE, CMD_INSERTTABLE, CMD_ITALIC, CMD_JUSTIFY, CMD_NUMBERS, CMD_OUTDENT, CMD_PASTE, CMD_REDO, CMD_SUBSCRIPT, CMD_SUPERSCRIPT, CMD_UNDERLINE, CMD_UNDO
 
Constructor Summary
DefaultRichTextRenderer()
          Constructs a DefaultRichTextRenderer
 
Method Summary
 nextapp.echo.Color[] getColorChoices(nextapp.echoservlet.RenderingContext rc, RichTextArea rta)
          This returns an array of colors that can be presented to the user when choosing a RichTextArea color.
 nextapp.echo.ImageReference getCommandImage(nextapp.echoservlet.RenderingContext rc, RichTextArea rta, java.lang.String command)
          This returns an image for a given RTA command.
 java.lang.String[][] getFontNames(nextapp.echoservlet.RenderingContext rc, RichTextArea rta)
          This returns a String[n][2] array of font name values and descriptive names.
 java.lang.String[][] getFontSizes(nextapp.echoservlet.RenderingContext rc, RichTextArea rta)
          This returns a String[n][2] array of font size values and descriptive names.
 java.lang.String[][] getParagraphStyles(nextapp.echoservlet.RenderingContext rc, RichTextArea rta)
          This returns a String[n][2] array of paragraph style values and descriptive names.
 java.lang.String[][] getSupportedCommands(nextapp.echoservlet.RenderingContext rc, RichTextArea rta)
          This returns a String[n][2] array of supported commands and descriptive names.
 void setCommandImage(java.lang.String command, nextapp.echo.ImageReference image)
          Sets the image for a given command.
 void setFontNames(java.lang.String[][] strings)
          Sets a new set of font name values to descriptive names mappings
 void setFontSizes(java.lang.String[][] strings)
          Sets a new set of font size values to descriptive names mappings
 void setParagraphStyles(java.lang.String[][] strings)
          Sets a new set of paragraph style values to descriptive names mappings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SUPPORTED_COMMANDS

public static java.lang.String[][] DEFAULT_SUPPORTED_COMMANDS
contains a mapping of supported commands (String) and descriptive titles (String)


DEFAULT_COMMAND_IMAGES

public static java.lang.Object[][] DEFAULT_COMMAND_IMAGES
contains a mapping of command (String) to image resources (ImageReference)


SIMPLE_FONT_NAMES

public static final java.lang.String[][] SIMPLE_FONT_NAMES
contains the simple font names most likely to be available to use


EXTENDED_FONT_NAMES

public static final java.lang.String[][] EXTENDED_FONT_NAMES
contains the extended font names that may be available for use


DEFAULT_FONT_NAMES

public static final java.lang.String[][] DEFAULT_FONT_NAMES
contains the default font names to use


DEFAULT_FONT_SIZES

public static final java.lang.String[][] DEFAULT_FONT_SIZES
contains the default font sizes to use


DEFAULT_PARAGRAPH_STYLES

public static final java.lang.String[][] DEFAULT_PARAGRAPH_STYLES
contains the default paragraph styles


DEFAULT_COLOR_CHOICES

public static final nextapp.echo.Color[] DEFAULT_COLOR_CHOICES
contains the default color choices

Constructor Detail

DefaultRichTextRenderer

public DefaultRichTextRenderer()
Constructs a DefaultRichTextRenderer

Method Detail

getFontNames

public java.lang.String[][] getFontNames(nextapp.echoservlet.RenderingContext rc,
                                         RichTextArea rta)
Description copied from interface: RichTextRenderer
This returns a String[n][2] array of font name values and descriptive names. If null is returned, then the Font Names select field will not be rendered by the RickTextArea. For example {"courier new,courier,monospace","Courier New"},

Specified by:
getFontNames in interface RichTextRenderer
Parameters:
rc - - the RenderingContext in place
rta - - the RichTextArea component in question
Returns:
- a [n][2] sized array mapping values to descriptive names.
See Also:
RichTextRenderer.getFontNames(nextapp.echoservlet.RenderingContext, echopoint.RichTextArea)

getFontSizes

public java.lang.String[][] getFontSizes(nextapp.echoservlet.RenderingContext rc,
                                         RichTextArea rta)
Description copied from interface: RichTextRenderer
This returns a String[n][2] array of font size values and descriptive names. If null is returned, then the Font Sizes select field will not be rendered by the RickTextArea. For example {"5","Size 5"},

Specified by:
getFontSizes in interface RichTextRenderer
Parameters:
rc - - the RenderingContext in place
rta - - the RichTextArea component in question
Returns:
- a [n][2] sized array mapping values to descriptive names.
See Also:
RichTextRenderer.getFontSizes(nextapp.echoservlet.RenderingContext, echopoint.RichTextArea)

getParagraphStyles

public java.lang.String[][] getParagraphStyles(nextapp.echoservlet.RenderingContext rc,
                                               RichTextArea rta)
Description copied from interface: RichTextRenderer
This returns a String[n][2] array of paragraph style values and descriptive names. If null is returned, then the Paragraph Styles select field will not be rendered by the RickTextArea. For example {"h1","Heading 1"},

Specified by:
getParagraphStyles in interface RichTextRenderer
Parameters:
rc - - the RenderingContext in place
rta - - the RichTextArea component in question
Returns:
- a [n][2] sized array mapping values to descriptive names.
See Also:
RichTextRenderer.getParagraphStyles(nextapp.echoservlet.RenderingContext, echopoint.RichTextArea)

getSupportedCommands

public java.lang.String[][] getSupportedCommands(nextapp.echoservlet.RenderingContext rc,
                                                 RichTextArea rta)
Description copied from interface: RichTextRenderer
This returns a String[n][2] array of supported commands and descriptive names. If null is returned, then no commands buttons will be rendered by the RickTextArea.

The order of the array is the order in which the commands will be rendered. The special markers

Specified by:
getSupportedCommands in interface RichTextRenderer
Parameters:
rc - - the RenderingContext in place
rta - - the RichTextArea component in question
Returns:
- a [n][2] sized array mapping command values to descriptive names.
See Also:
RichTextRenderer.getSupportedCommands(nextapp.echoservlet.RenderingContext, echopoint.RichTextArea)

getCommandImage

public nextapp.echo.ImageReference getCommandImage(nextapp.echoservlet.RenderingContext rc,
                                                   RichTextArea rta,
                                                   java.lang.String command)
Description copied from interface: RichTextRenderer
This returns an image for a given RTA command.

This function will only be called for commands that have been allowed via a previous call to the getSupportedCommands method.

Specified by:
getCommandImage in interface RichTextRenderer
Parameters:
rc - - the RenderingContext in place
rta - - the RichTextArea component in question
command - - the command in question
Returns:
- an ImageReference for the command
See Also:
RichTextRenderer.getCommandImage(nextapp.echoservlet.RenderingContext, echopoint.RichTextArea, java.lang.String)

getColorChoices

public nextapp.echo.Color[] getColorChoices(nextapp.echoservlet.RenderingContext rc,
                                            RichTextArea rta)
Description copied from interface: RichTextRenderer
This returns an array of colors that can be presented to the user when choosing a RichTextArea color.

Specified by:
getColorChoices in interface RichTextRenderer
Parameters:
rc - - the RenderingContext in place
rta - - the RichTextArea component in question
Returns:
- an array of Colors
See Also:
RichTextRenderer.getColorChoices(nextapp.echoservlet.RenderingContext, echopoint.RichTextArea)

setFontNames

public void setFontNames(java.lang.String[][] strings)
Sets a new set of font name values to descriptive names mappings

Parameters:
strings -

setFontSizes

public void setFontSizes(java.lang.String[][] strings)
Sets a new set of font size values to descriptive names mappings

Parameters:
strings -

setParagraphStyles

public void setParagraphStyles(java.lang.String[][] strings)
Sets a new set of paragraph style values to descriptive names mappings

Parameters:
strings - - the array of mappings

setCommandImage

public void setCommandImage(java.lang.String command,
                            nextapp.echo.ImageReference image)
Sets the image for a given command.

Parameters:
command - - the command in question
image - - the new image for the command

EchoPoint
1.0