Examples: Spacing property (View - Java™)
This agent toggles the spacing for a view.
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 = null;
view = db.getView("All Documents");
if (view.getSpacing() == View.SPACING_SINGLE) {
view.setSpacing(View.SPACING_ONE_POINT_25);
System.out.println("New spacing is 1.25");
}
else if (view.getSpacing() == View.SPACING_ONE_POINT_25) {
view.setSpacing(View.SPACING_ONE_POINT_50);
System.out.println("New spacing is 1.5");
}
else if (view.getSpacing() == View.SPACING_ONE_POINT_50) {
view.setSpacing(View.SPACING_ONE_POINT_75);
System.out.println("New spacing is 1.75");
}
else if (view.getSpacing() == View.SPACING_ONE_POINT_75) {
view.setSpacing(View.SPACING_DOUBLE);
System.out.println("New spacing is double");
}
else {
view.setSpacing(View.SPACING_SINGLE);
System.out.println("New spacing is single");
}
} catch(Exception e) {
e.printStackTrace();
}
}
}