コード例 #1
0
 public void menuItemState(XJMenuItem item) {
   switch (item.getTag()) {
     case XJMainMenuBar.MI_NEW:
       item.setTitle(
           XJLocalizable.getXJString("New")
               + ((XJApplication.shared().getDocumentExtensions().size() > 1) ? "..." : ""));
       break;
     case XJMainMenuBar.MI_UNDO:
     case XJMainMenuBar.MI_REDO:
       getMainMenuBar().menuUndoRedoItemState(undoEngine.getCurrentUndo());
       break;
   }
 }
コード例 #2
0
 public void handleMenuEvent(XJMenu menu, XJMenuItem item) {
   switch (item.getTag()) {
     case XJMainMenuBar.MI_UNDO:
       performUndo();
       break;
     case XJMainMenuBar.MI_REDO:
       performRedo();
       break;
     case XJMainMenuBar.MI_CUT:
       performActionOnFocusedJComponent(DefaultEditorKit.cutAction);
       break;
     case XJMainMenuBar.MI_COPY:
       performActionOnFocusedJComponent(DefaultEditorKit.copyAction);
       break;
     case XJMainMenuBar.MI_PASTE:
       performActionOnFocusedJComponent(DefaultEditorKit.pasteAction);
       break;
     case XJMainMenuBar.MI_SELECT_ALL:
       performActionOnFocusedJComponent(DefaultEditorKit.selectAllAction);
       break;
   }
 }