例: HeaderAlignment

次のエージェントは、ヘッダーのアライメントを切り替えます。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

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

      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      View view = db.getView("Categorized");
      ViewColumn vc = view.getColumn(2);
      if (vc.getHeaderAlignment() == ViewColumn.ALIGN_LEFT)
        vc.setHeaderAlignment(ViewColumn.ALIGN_RIGHT);
      else if (vc.getHeaderAlignment() == ViewColumn.ALIGN_RIGHT)
        vc.setHeaderAlignment(ViewColumn.ALIGN_CENTER);
      else
        vc.setHeaderAlignment(ViewColumn.ALIGN_LEFT);
        
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}