org.apache.fop.render.rtf.rtflib.rtfdoc

Class RtfText


public class RtfText
extends RtfElement

Model of a text run (a piece of text with attributes) in an RTF document
Author:
Bertrand Delacretaz bdelacretaz@codeconsult.ch

Field Summary

static String[]
ALIGNMENT
RtfText attributes: this must contain all allignment attributes names
static String
ALIGN_CENTER
constant for align center
static String
ALIGN_DISTRIBUTED
constant for align distributed
static String
ALIGN_JUSTIFIED
constant for align justified
static String
ALIGN_LEFT
constant for align left
static String
ALIGN_RIGHT
constant for align right
static String
ATTR_BACKGROUND_COLOR
constant for background color
static String
ATTR_BOLD
constant for bold
static String
ATTR_FONT_COLOR
constant for font color
static String
ATTR_FONT_FAMILY
constant for font family
static String
ATTR_FONT_SIZE
constant for font size
static String
ATTR_ITALIC
constant for italic
static String[]
ATTR_NAMES
RtfText attributes: this must contain all attribute names
static String
ATTR_STRIKETHROUGH
constant for underline
static String
ATTR_SUBSCRIPT
constant for subscript
static String
ATTR_SUPERSCRIPT
constant for superscript
static String
ATTR_UNDERLINE
constant for underline
static String
BDR_BOTTOM_DASH
constant for bottom dashed border
static String
BDR_BOTTOM_DOTTED
constant for bottom dotted border
static String
BDR_BOTTOM_DOUBLE
constant for bottom double border
static String
BDR_BOTTOM_EMBOSS
constant for bottom embossed border
static String
BDR_BOTTOM_SINGLE
constant for bottom single border
static String[]
BORDER
RtfText attributes:: this must contain all border attribute names
static int
FULL_SHADING
Constant for the 100% shading of the paragraph
static String[]
INDENT
String array of indent constants
static String
LEFT_INDENT_BODY
constant for left indent body
static String
LEFT_INDENT_FIRST
constant for left indent first
static String
RIGHT_INDENT_BODY
constant for right indent body
static String
RTF_FIELD
constant for field
static String
RTF_FIELD_PAGE
constant for field page
static String
RTF_FIELD_RESULT
constant for field result
static String
SHADING
Constant for the shading of the paragraph
static String
SHADING_FRONT_COLOR
Constant for the document's color tableshading of the paragraph
static String
SPACE_AFTER
Space after a paragraph
static String
SPACE_BEFORE
Space before/after a paragraph
static String[]
TABS
String array of tab constants
static String
TAB_CENTER
constant for center tab
static String
TAB_LEADER_DOTS
constant for tab leader dots
static String
TAB_LEADER_EQUALS
constant for tab leader equals
static String
TAB_LEADER_HYPHEN
constant for tab leader hyphens
static String
TAB_LEADER_THICK
constant for tab leader thick
static String
TAB_LEADER_UNDER
constant for tab leader underscores
static String
TAB_RIGHT
constant for right tab

Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

attrib, parent, writer

Method Summary

RtfAttributes
getTextAttributes()
RtfAttributes
getTextContainerAttributes()
IRtfTextContainer requirement:
boolean
isBold(boolean isStart)
boolean
isEmpty()
Checks whether the text is empty.
boolean
isNbsp()
True if text contains a single non-breaking space (#160).
boolean
isNewLine()
boolean
isTab()
void
writeRtfContent()
Write our text to the RTF stream

Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

close, getRtfAttributes, isEmpty, newLine, okToWriteRtf, toString, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfContent, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS

Field Details

ALIGNMENT

public static final String[] ALIGNMENT
RtfText attributes: this must contain all allignment attributes names

ALIGN_CENTER

public static final String ALIGN_CENTER
constant for align center

ALIGN_DISTRIBUTED

public static final String ALIGN_DISTRIBUTED
constant for align distributed

ALIGN_JUSTIFIED

public static final String ALIGN_JUSTIFIED
constant for align justified

ALIGN_LEFT

public static final String ALIGN_LEFT
constant for align left

ALIGN_RIGHT

public static final String ALIGN_RIGHT
constant for align right

ATTR_BACKGROUND_COLOR

public static final String ATTR_BACKGROUND_COLOR
constant for background color

ATTR_BOLD

public static final String ATTR_BOLD
constant for bold

ATTR_FONT_COLOR

public static final String ATTR_FONT_COLOR
constant for font color

ATTR_FONT_FAMILY

public static final String ATTR_FONT_FAMILY
constant for font family

ATTR_FONT_SIZE

public static final String ATTR_FONT_SIZE
constant for font size

ATTR_ITALIC

public static final String ATTR_ITALIC
constant for italic

ATTR_NAMES

public static final String[] ATTR_NAMES
RtfText attributes: this must contain all attribute names

ATTR_STRIKETHROUGH

public static final String ATTR_STRIKETHROUGH
constant for underline

ATTR_SUBSCRIPT

public static final String ATTR_SUBSCRIPT
constant for subscript

ATTR_SUPERSCRIPT

public static final String ATTR_SUPERSCRIPT
constant for superscript

ATTR_UNDERLINE

public static final String ATTR_UNDERLINE
constant for underline

BDR_BOTTOM_DASH

public static final String BDR_BOTTOM_DASH
constant for bottom dashed border

BDR_BOTTOM_DOTTED

public static final String BDR_BOTTOM_DOTTED
constant for bottom dotted border

BDR_BOTTOM_DOUBLE

public static final String BDR_BOTTOM_DOUBLE
constant for bottom double border

BDR_BOTTOM_EMBOSS

public static final String BDR_BOTTOM_EMBOSS
constant for bottom embossed border

BDR_BOTTOM_SINGLE

public static final String BDR_BOTTOM_SINGLE
constant for bottom single border

BORDER

public static final String[] BORDER
RtfText attributes:: this must contain all border attribute names

FULL_SHADING

public static final int FULL_SHADING
Constant for the 100% shading of the paragraph
Field Value:
10000

INDENT

public static final String[] INDENT
String array of indent constants

LEFT_INDENT_BODY

public static final String LEFT_INDENT_BODY
constant for left indent body

LEFT_INDENT_FIRST

public static final String LEFT_INDENT_FIRST
constant for left indent first

RIGHT_INDENT_BODY

public static final String RIGHT_INDENT_BODY
constant for right indent body

RTF_FIELD

public static final String RTF_FIELD
constant for field

RTF_FIELD_PAGE

public static final String RTF_FIELD_PAGE
constant for field page

RTF_FIELD_RESULT

public static final String RTF_FIELD_RESULT
constant for field result

SHADING

public static final String SHADING
Constant for the shading of the paragraph

SHADING_FRONT_COLOR

public static final String SHADING_FRONT_COLOR
Constant for the document's color tableshading of the paragraph

SPACE_AFTER

public static final String SPACE_AFTER
Space after a paragraph

SPACE_BEFORE

public static final String SPACE_BEFORE
Space before/after a paragraph

TABS

public static final String[] TABS
String array of tab constants

TAB_CENTER

public static final String TAB_CENTER
constant for center tab

TAB_LEADER_DOTS

public static final String TAB_LEADER_DOTS
constant for tab leader dots

TAB_LEADER_EQUALS

public static final String TAB_LEADER_EQUALS
constant for tab leader equals

TAB_LEADER_HYPHEN

public static final String TAB_LEADER_HYPHEN
constant for tab leader hyphens

TAB_LEADER_THICK

public static final String TAB_LEADER_THICK
constant for tab leader thick

TAB_LEADER_UNDER

public static final String TAB_LEADER_UNDER
constant for tab leader underscores

TAB_RIGHT

public static final String TAB_RIGHT
constant for right tab

Method Details

getTextAttributes

public RtfAttributes getTextAttributes()
Returns:
the attributes of our text

getTextContainerAttributes

public RtfAttributes getTextContainerAttributes()
IRtfTextContainer requirement:
Returns:
a copy of our attributes

isBold

public boolean isBold(boolean isStart)
Parameters:
isStart - set to true if processing the start of the text (??)
Returns:
true if text is bold

isEmpty

public boolean isEmpty()
Checks whether the text is empty.
Overrides:
isEmpty in interface RtfElement
Returns:
true If m_text is null\n false m_text is set

isNbsp

public boolean isNbsp()
True if text contains a single non-breaking space (#160). TODO make this more general and/or merge with isEmpty? -- what happen with empty paragraphs, if they will be removed, than NO, else ok
Returns:
true If m_text is character 160\n false m_text is not a nbsp

isNewLine

public boolean isNewLine()
Returns:
true if text is a newline character

isTab

public boolean isTab()
Returns:
true if the text is a tab character

writeRtfContent

public void writeRtfContent()
            throws IOException
Write our text to the RTF stream
Overrides:
writeRtfContent in interface RtfElement

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.