JAVA/CORBA クラス


例:addNewLine メソッド、addPageBreak メソッド、addTab メソッド、appendText メソッド
次のエージェントは、リッチテキストアイテムを作成し、テキストを追加し、さらに改行、改ページ、およびタブを追加します。

import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
 public void NotesMain() {
   try {
     Session session = getSession();
     AgentContext agentContext = session.getAgentContext();
     // (Your code goes here)
     Database db = agentContext.getCurrentDatabase();
     Document doc = db.createDocument();
     Item subject = doc.replaceItemValue("Subject","Rich text item");
     RichTextItem body = doc.createRichTextItem("Body");
     body.appendText("This is the first sentence.");
     body.appendText(" This is the second sentence.");
     body.addNewLine(2);
     body.appendText("This is a new paragraph.");
     body.addPageBreak();
       body.appendText("Column 1");
         body.addTab();
           body.appendText("Column 2");
     body.addNewLine();
       body.appendText("Element A1");
         body.addTab();
           body.appendText("Element B1");
     body.addNewLine();
       body.appendText("Element A2");
         body.addTab();
           body.appendText("Element B2");
     // Save the document
     doc.save(true, true);
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

関連項目