コード例 #1
0
    /**
     * Creates the 'Edit' menu.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     *
     * @generated
     */
    protected IMenuManager createEditMenu(IWorkbenchWindow window) {
      IMenuManager menu =
          new MenuManager(getString("_UI_Menu_Edit_label"), IWorkbenchActionConstants.M_EDIT);
      menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));

      addToMenuAndRegister(menu, ActionFactory.UNDO.create(window));
      addToMenuAndRegister(menu, ActionFactory.REDO.create(window));
      menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
      menu.add(new Separator());

      addToMenuAndRegister(menu, ActionFactory.CUT.create(window));
      addToMenuAndRegister(menu, ActionFactory.COPY.create(window));
      addToMenuAndRegister(menu, ActionFactory.PASTE.create(window));
      menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
      menu.add(new Separator());

      addToMenuAndRegister(menu, ActionFactory.DELETE.create(window));
      addToMenuAndRegister(menu, ActionFactory.SELECT_ALL.create(window));
      menu.add(new Separator());

      menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));

      menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
      menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
      return menu;
    }
コード例 #2
0
ファイル: ServerView.java プロジェクト: KiyoungKim/Nabee
  private void registContextMenu(Composite parent) {
    IWorkbenchWindow window = getSite().getWorkbenchWindow();

    IWorkbenchAction renameAction = ActionFactory.RENAME.create(window);
    renameAction.setToolTipText(NBLabel.get(0x006B));
    renameAction.setText(NBLabel.get(0x006E));

    IWorkbenchAction refreshAction = ActionFactory.REFRESH.create(window);
    refreshAction.setToolTipText(NBLabel.get(0x025F));
    refreshAction.setText(NBLabel.get(0x0260));

    IWorkbenchAction deleteAction = ActionFactory.DELETE.create(window);
    deleteAction.setToolTipText(NBLabel.get(0x0062));
    deleteAction.setText(NBLabel.get(0x0068));

    MenuManager newMgr = new MenuManager("&New                    ", "file.mnuNew");
    newMgr.add(new NewServerAction(window));
    newMgr.add(new Separator());
    newMgr.add(new GroupMarker("file.new.OTHERS"));

    MenuManager mgr = new MenuManager();
    mgr.add(newMgr);
    mgr.add(new Separator());
    mgr.add(ResourceFactory.CONNECT.create(window));
    mgr.add(ResourceFactory.DISCONNECT.create(window));
    mgr.add(new Separator());
    mgr.add(refreshAction);
    mgr.add(new Separator());
    mgr.add(deleteAction);
    mgr.add(renameAction);
    mgr.add(new Separator());
    mgr.add(new PropertyAction(window));

    Menu menu = mgr.createContextMenu(parent);
    treeViewer.getTree().setMenu(menu);
  }
コード例 #3
0
  /** @generated NOT */
  protected void makeActions(IWorkbenchWindow window) {
    toggleCoolbarAction = ActionFactory.TOGGLE_COOLBAR.create(window);
    register(toggleCoolbarAction);
    lockToolBarAction = ActionFactory.LOCK_TOOL_BAR.create(window);
    register(lockToolBarAction);

    // register(ActionFactory.CLOSE.create(window));

    // register(ActionFactory.CLOSE_ALL.create(window));

    register(ActionFactory.SAVE.create(window));

    register(ActionFactory.SAVE_AS.create(window));

    register(ActionFactory.SAVE_ALL.create(window));

    register(ActionFactory.QUIT.create(window));

    register(ActionFactory.UNDO.create(window));

    register(ActionFactory.REDO.create(window));

    register(ActionFactory.CUT.create(window));

    register(ActionFactory.COPY.create(window));

    register(ActionFactory.PASTE.create(window));

    register(ActionFactory.DELETE.create(window));

    register(ActionFactory.SELECT_ALL.create(window));

    register(ActionFactory.OPEN_NEW_WINDOW.create(window));

    register(ActionFactory.PRINT.create(window));
  }