getNextElement (RichTextNavigator - Java)

Returns the element of a specified type at a position in a rich text item after the current position.

Defined in

RichTextNavigator

Syntax

public Base getNextElement()
    throws NotesException
public Base getNextElement(int type)
    throws NotesException
public Base getNextElement(int type, int occurrence)
    throws NotesException

Parameters

int type
  • RichTextItem.RTELEM_TYPE_DOCLINK
  • RichTextItem.RTELEM_TYPE_FILEATTACHMENT
  • RichTextItem.RTELEM_TYPE_OLE
  • RichTextItem.RTELEM_TYPE_SECTION
  • RichTextItem.RTELEM_TYPE_TABLE

Defaults to the type last specified by a find method.

int occurrence

The position of the element, within elements of the specified type, relative to the current position; 1 means the next element, 2 means the element after the next element, and so on. Must be a positive integer; you cannot use this method to find preceding elements. Defaults to 1.

Return value

Base

EmbeddedObject, RichTextDocLink, RichTextSection, or RichTextTable. The requested element. You must cast the return value to the type required. Returns null if there is no element.

Usage

An exception occurs occurs if you try to get an element of type RTELEM_TYPE_TABLECELL, RTELEM_TYPE_TEXTPARAGRAPH, or RTELEM_TYPE_TEXTRUN. Access these elements through RichTextRange.

This method fails if a current position does not exist, for example, if you use this method without first calling findFirstElement, findNextElement, or findNthElement.

This method moves the current position to the position of the retrieved element.

Example