JAVA/CORBA CLASSES


Examples: NumberFormat property
This agent toggles the format for a numeric column.

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("All Documents");
     ViewColumn vc = view.getColumn(6);
     String fmtString = null;
     if (vc.getNumberFormat() == ViewColumn.FMT_GENERAL) {
       vc.setNumberFormat(ViewColumn.FMT_FIXED);
       fmtString = "Fixed";
     }
     else if (vc.getNumberFormat() == ViewColumn.FMT_FIXED) {
       vc.setNumberFormat(ViewColumn.FMT_CURRENCY);
       fmtString = "Currency";
     }
     else if (vc.getNumberFormat() == ViewColumn.FMT_CURRENCY) {
       vc.setNumberFormat(ViewColumn.FMT_SCIENTIFIC);
       fmtString = "Scientific";
     }
     else {
       vc.setNumberFormat(ViewColumn.FMT_GENERAL);
       fmtString = "General";
     }
     System.out.println("Number format = " + fmtString);
       
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also