Examples: TitleStyle property (RichTextSection - Java)

This agent displays the font size of the title of each section in a rich text item.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      DocumentCollection dc = agentContext.getUnprocessedDocuments();
      Document doc = dc.getFirstDocument();
      RichTextItem body = (RichTextItem)doc.getFirstItem("Body");
      RichTextNavigator rtnav = body.createNavigator();
      if (rtnav.findFirstElement(RichTextItem.RTELEM_TYPE_SECTION)) {
        do {
          RichTextSection rtsection = (RichTextSection)rtnav.getElement();
          RichTextStyle rtstyle = rtsection.getTitleStyle();
          System.out.println(
            rtsection.getTitle() + "\n\tFont size = " + 
            rtstyle.getFontSize());
        } while (rtnav.findNextElement()); 
      }
      else
        System.out.println("No sections in Body");

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}