public CorporateCommands contextCommands(
     String topicmapID, String viewmode, Session session, CorporateDirectives directives) {
   CorporateCommands commands = new CorporateCommands(as);
   //
   int editorContext = as.editorContext(topicmapID);
   commands.addNavigationCommands(this, editorContext, session);
   // --- send/reply/forward ---
   String s = getProperty(PROPERTY_STATUS);
   commands.addSeparator();
   if (s.equals(EMAIL_STATE_DRAFT)) {
     commands.addCommand(
         ITEM_ATTACH_DOCUMENT, CMD_ATTACH_DOCUMENT, FILESERVER_ICONS_PATH, ICON_ATTACH_DOCUMENT);
     commands.addCommand(ITEM_SEND, CMD_SEND, FILESERVER_IMAGES_PATH, ICON_SEND);
   } else if (s.equals(EMAIL_STATE_RECEIVED)) {
     commands.addCommand(ITEM_REPLY, CMD_REPLY);
     commands.addCommand(ITEM_FORWARD, CMD_FORWARD);
   } else if (s.equals(EMAIL_STATE_SENT)) {
     commands.addCommand(ITEM_FORWARD, CMD_FORWARD);
   } else {
     throw new DeepaMehtaException("unexpected email status: \"" + s + "\"");
   }
   //
   commands.addStandardCommands(this, editorContext, viewmode, session, directives);
   //
   return commands;
 }
 public CorporateCommands contextCommands(
     String topicmapID, String viewmode, Session session, CorporateDirectives directives) {
   CorporateCommands commands = new CorporateCommands(as);
   int editorContext = as.editorContext(topicmapID);
   //
   commands.addNavigationCommands(this, editorContext, session);
   // --- "Reply" ---
   int cmdState = isToplevelMessage() ? COMMAND_STATE_DEFAULT : COMMAND_STATE_DISABLED;
   commands.addSeparator();
   commands.addCommand(ITEM_REPLY_TO_MESSAGE, CMD_REPLY_TO_MESSAGE, cmdState);
   //
   commands.addStandardCommands(this, editorContext, viewmode, session, directives);
   //
   return commands;
 }
 public CorporateCommands contextCommands(
     String topicmapID, String viewmode, Session session, CorporateDirectives directives) {
   CorporateCommands commands = new CorporateCommands(as);
   int editorContext = as.editorContext(topicmapID);
   //
   commands.addNavigationCommands(this, editorContext, session);
   commands.addSeparator();
   // --- "Lock"/"Unlock" ---
   boolean isLocked = getProperty(PROPERTY_LOCKED_GEOMETRY).equals(SWITCH_ON);
   int lockState = !isLocked ? COMMAND_STATE_DEFAULT : COMMAND_STATE_DISABLED;
   int unlockState = isLocked ? COMMAND_STATE_DEFAULT : COMMAND_STATE_DISABLED;
   //
   commands.addCommand(ITEM_LOCK_GEOMETRY, CMD_LOCK_GEOMETRY, lockState);
   commands.addCommand(ITEM_UNLOCK_GEOMETRY, CMD_UNLOCK_GEOMETRY, unlockState);
   // --- standard topic commands ---
   commands.addStandardCommands(this, editorContext, viewmode, session, directives);
   //
   return commands;
 }