Package com.intellij.openapi.actionSystem

Examples of com.intellij.openapi.actionSystem.AnAction


  }

  private void fillWithUserActions(User[] users, List<AnAction> result, final VirtualFile file, final Editor editor) {
    for (final User user : users) {
      if (shouldAddUserToChoiceList(user)) {
        result.add(new AnAction(user.getDisplayName()) {
          public void actionPerformed(AnActionEvent e) {
            doActionCommand(user, file, editor);
          }

          public void update(AnActionEvent e) {
View Full Code Here


   
    super.removeNotify();
  }

  private void addResetPreferencesActionTo(DefaultActionGroup actionGroup) {
    myResetSettingsAction = new AnAction("Reset to default settings") {
      public void actionPerformed(AnActionEvent e) {
        try {
          Preferences preferences = Preferences.userRoot().node("jetbrains.communicator");
          preferences.removeNode();
          preferences.flush();
View Full Code Here

            }
          }
        }
      }
      if (!items.isEmpty()) {
        AnAction action = ActionManager.getInstance().getAction("GotoRelated");
        String tooltipAd = "";
        String popupTitleAd = "";
        if (action != null) {
          String shortcutText = KeymapUtil.getFirstKeyboardShortcutText(action);
          String actionText = StringUtil.isEmpty(shortcutText) ? "'" + action.getTemplatePresentation().getText() + "' action" : shortcutText;
          tooltipAd = "\nGo to sub-expression code via " + actionText;
          popupTitleAd = " (for sub-expressions use " + actionText + ")";
        }
        String title = "parser " + (hasPSI ? "and PSI " : "") + "code";
        NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(BnfIcons.RELATED_METHOD).
View Full Code Here

    performActionTest();
    checkResultByFile(getBasePath() + "/after" + getTestName(false) + ".java");
  }

  protected void performActionTest() {
    AnAction anAction = getAction();

    DataContext context = DataManager.getInstance().getDataContext();
    AnActionEvent anActionEvent = new AnActionEvent(null, context, "", anAction.getTemplatePresentation(), ActionManager.getInstance(), 0);

    anAction.actionPerformed(anActionEvent);
    FileDocumentManager.getInstance().saveAllDocuments();
  }
View Full Code Here

    list.getActionMap().put(SELECT_FIRST_ROW_ACTION_ID, new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
        moveHome(list);
      }
    });
    new AnAction() {
      public void actionPerformed(AnActionEvent e) {
        moveHome(list);
      }
    }.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0)), list);
    new AnAction() {
      public void actionPerformed(AnActionEvent e) {
        moveEnd(list);
      }
    }.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0)), list);
  }
View Full Code Here

      myTextField.setBorder(IdeBorderFactory.createEmptyBorder(0, 5, 0, 5));
    }

    final ActionManager actionManager = ActionManager.getInstance();
    if (actionManager != null) {
      final AnAction clearTextAction = actionManager.getAction(IdeActions.ACTION_CLEAR_TEXT);
      if (clearTextAction.getShortcutSet().getShortcuts().length == 0) {
        clearTextAction.registerCustomShortcutSet(CommonShortcuts.ESCAPE, this);
      }
    }
  }
View Full Code Here

    checkResultByFile(null, filePathAfter, ignoreTrailingSpaces);
  }

  private void invokeAction() {
    final String actionId = getActionId();
    final AnAction action = ActionManager.getInstance().getAction(actionId);
    //noinspection HardCodedStringLiteral
    assertNotNull("Can find registered action with id=" + actionId, action);
    action.actionPerformed(
        new AnActionEvent(
            null,
            DataManager.getInstance().getDataContext(),
            "",
            action.getTemplatePresentation(),
            ActionManager.getInstance(),
            0
        )
    );
  }
View Full Code Here

    }

    @Override
    protected List<AnAction> createActions() {
        return Arrays.<AnAction>asList(
                new AnAction("Update", "", icon("/actions/sync.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        HerokuLogsWindow.this.doUpdate();
                    }
                }
        );
View Full Code Here

    }

    @Override
    protected List<AnAction> createActions() {
        return Arrays.asList(
                new AnAction("Release Info", "", icon("/compiler/information.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        final Release release = tableModel.getRelease(selectedRow.get());
                        if (release==null) return;
                        final Release releaseInfo = herokuProjectService.getReleaseInfo(release);
                        String html=tableModel.renderRelease(releaseInfo);
                        Messages.showMessageDialog(html, "Release Info", Messages.getInformationIcon());
                    }
                },
                new AnAction("Rollback", "", icon("/actions/rollback.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        final Release release = tableModel.getRelease(selectedRow.get());
                        if (release==null) return;
                        if (Messages.showYesNoDialog("Rollback to the Release: "+release.getName(),"Rollback to Release",Messages.getQuestionIcon())!=Messages.YES) return;
                        herokuProjectService.rollbackTo(release);
                        HerokuReleasesWindow.this.doUpdate();
                    }
                },
                new AnAction("Update", "", icon("/actions/sync.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        HerokuReleasesWindow.this.doUpdate();
                    }
                }
        );
View Full Code Here

    }

    @Override
    protected List<AnAction> createActions() {
        return Arrays.<AnAction>asList(
                new AnAction("Add Collaborator Variable", "", icon("/general/add.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        String email = Messages.showInputDialog(getProject(), "Collaborator Heroku email:", "Add Collaborator", Messages.getQuestionIcon());
                        if (email!=null && !email.isEmpty()) return;
                        herokuProjectService.addCollaborator(email);
                        HerokuCollaboratorsWindow.this.doUpdate();
                    }
                },
                new AnAction("Remove Config Variable", "", icon("/general/remove.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        final Collaborator collaborator = tableModel.getCollaborator(selectedRow.get());
                        if (collaborator==null) return;
                        if (Messages.showYesNoDialog("Remove the Collaborator: "+collaborator.getEmail(),"Remove Collaborator",Messages.getQuestionIcon())!=Messages.YES) return;
                        herokuProjectService.removeCollaborator(collaborator.getEmail());
                        HerokuCollaboratorsWindow.this.doUpdate();
                    }
                },
                new AnAction("Update", "", icon("/actions/sync.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        HerokuCollaboratorsWindow.this.doUpdate();
                    }
                }
        );
View Full Code Here

TOP

Related Classes of com.intellij.openapi.actionSystem.AnAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.