例: Position property (ViewColumn - Java™)

次のエージェントは、ビューのすべての列のタイトルと位置を表示します。

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();
      View view = db.getView("All Documents");
      Vector columns = view.getColumns();
      for (int i = 0; i < columns.size(); i++) {
        ViewColumn column = (ViewColumn)columns.elementAt(i);
        String title = column.getTitle();
        if (title.length() == 0) title = "<No title>";
        System.out.println(
          "Position " + column.getPosition() + ": " + title);
      }
        
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}