JAVA/CORBA CLASSES


Working with text in Java classes
Text includes text paragraphs and text runs, rich text styles, rich text paragraph styles, and tabs. A text run is text until the style changes or the paragraph ends.

Text paragraphs and text runs

To find text in a rich text item, use the RichTextNavigator methods in conjunction with the type RichTextItem.RTELEM_TYPE_TEXTPARAGRAPH or RichTextItem.RTELEM_TYPE_TEXTRUN. To get text, create a RichTextRange object with createRange and delineate the text with the following methods:


For example, if you find an element of type RichTextItem.RTELEM_TYPE_TEXTPARAGRAPH with RichTextNavigator, then call setBegin passing it the navigator, your range starts at that paragraph.

The RichTextRange class has the following properties:

PropertyData TypeDescription
getNavigatorRichTextNavigatorA navigator confined to the range. This allows you, for example, to get the text runs in a text paragraph.
getStyleRichTextStyleThe style of the first text run in the range.
getTextParagraphStringThe text of the first paragraph in the range.
getTextRunStringThe text of the first run in the range.
getTypeStringThe type of the first element in the range.
In addition to setBegin and setEnd, the RichTextRange class has the following methods:
Text creation

To create text in a rich text item, use the following methods:


Rich text styles

You can access rich text style properties through the RichTextStyle class. The RichTextStyle class contains the following properties:

PropertyData TypeDescription
getBold and setBoldintBold rich text attribute
getEffects and setEffectsintEffects (emboss, extrude, and so on)
getFont and setFontintFont rich text attribute
getFontSize and setFontSizeintFont size in points
isDefaultbooleanIf all attributes are in a default state
getItalic and setItalicintItalic rich text attribute
getColor and setColorintColor rich text attribute
getParentSessionThe session that contains a RichTextStyle object
getPassThruHTML and setPassThruHTMLintHTML attribute
getStrikeThrough and setStrikeThroughintStrikethrough rich text attribute
getUnderline and setUnderlineintUnderline rich text attribute
The method appendStyle appends a style to the end of a rich text item. Text following the style is rendered using that styles's attributes until another style is appended.

Use getNotesFont in RichTextItem to establish font identifiers for Font.

Rich text paragraph styles

The RichTextParagraphStyle allows you to access the following attributes of a rich text paragraph object:

PropertyData typeDescription
getAlignment and setAlignment intAlignment attribute of a rich text paragraph
getFirstLineLeftMargin and setFirstLineLeftMarginintFirst line left margin attribute of a rich text paragraph
getInterLineSpacing and setInterLineSpacingintInterline spacing attribute of a rich text paragraph
getLeftMargin and setLeftMarginintLeft margin attribute of a rich text paragraph
getRightMargin and setRightMarginintRight margin attribute of a rich text paragraph
getSpacingAbove and setSpacingAboveintSpacing above attribute of a rich text paragraph
getSpacingBelow and setSpacingBelowintSpacing below attribute of a rich text paragraph
getTabsVector of RichTextTabTabs in a rich text paragraph style
Use the createRichTextParagraphStyle method of Session to create a new rich text paragraph style object.

Tabs

You can manipulate the tabs in a rich text paragraph style object through the clearAllTabs, setTab, and setTabs methods in RichTextParagraphStyle, and the clear method in RichTextTab.

The following table lists the properties in the RichTextTab class.

PropertyDescription
getPositionPosition of the tab in a rich text paragraph style
getTypeType of tab