Examples: Position property (ViewColumn - Java)

This agent displays the titles and positions of all the columns in a view.

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();
    }
  }
}