JAVA/CORBA CLASSES


Examples: IsDefault property
This agent demonstrates the default state after creating and changing a rich text style.

import lotus.domino.*;
import java.util.Vector;

public class JavaAgent extends AgentBase {
   
 RichTextStyle rtstyle = null;

 public void NotesMain() {

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

     // (Your code goes here)
     rtstyle = session.createRichTextStyle();
     System.out.println("After creating rich text style");
     checkForDefault();
       // Default at this point
     rtstyle.setBold(RichTextStyle.YES);
     System.out.println("After setting style bold YES");
     checkForDefault();
       // Not default
     rtstyle.setBold(RichTextStyle.NO);
     System.out.println("After setting style bold NO");
     checkForDefault();
       // Not default
     rtstyle.setBold(RichTextStyle.STYLE_NO_CHANGE);
     System.out.println("After setting style bold STYLE_NO_CHANGE");
     checkForDefault();
       // Back to default

   } catch(Exception e) {
     e.printStackTrace();
   }
 }
 
 void checkForDefault() {
   try {
     if (rtstyle.isDefault())
       System.out.println("\tIs default style");
     else
       System.out.println("\tIs not default style");
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also