예제 #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
  private void makeActions() {
    executeAction = new ExecuteQueryAction();

    IWorkbenchWindow window = getEditorSite().getWorkbenchWindow();
    IWorkbenchAction globalAction = ActionFactory.COPY.create(window);
    copyQueryStringAction =
        new Action() {
          @Override
          public void run() {
            queryString.copy();
          }
        };
    copyQueryStringAction.setAccelerator(globalAction.getAccelerator());

    contentAssistAction =
        new Action() {
          @Override
          public void run() {
            queryViewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
          }
        };
    // Install the standard text actions.
    addAction(
        ActionFactory.CUT, ITextOperationTarget.CUT, "org.eclipse.ui.edit.cut"); // $NON-NLS-1$
    addAction(
        ActionFactory.COPY, ITextOperationTarget.COPY, "org.eclipse.ui.edit.copy"); // $NON-NLS-1$
    addAction(
        ActionFactory.PASTE,
        ITextOperationTarget.PASTE,
        "org.eclipse.ui.edit.paste"); //$NON-NLS-1$
    addAction(
        ActionFactory.DELETE,
        ITextOperationTarget.DELETE,
        "org.eclipse.ui.edit.delete"); //$NON-NLS-1$
    addAction(
        ActionFactory.SELECT_ALL,
        ITextOperationTarget.SELECT_ALL,
        "org.eclipse.ui.edit.selectAll"); //$NON-NLS-1$
    undo =
        addAction(
            ActionFactory.UNDO,
            ITextOperationTarget.UNDO,
            "org.eclipse.ui.edit.undo"); //$NON-NLS-1$
    redo =
        addAction(
            ActionFactory.REDO,
            ITextOperationTarget.REDO,
            "org.eclipse.ui.edit.redo"); //$NON-NLS-1$
  }
  /** @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));
  }