Package com.intellij.openapi.project

Examples of com.intellij.openapi.project.DumbAwareAction


    });
    final JBPopup[] popup = new JBPopup[1];

    KeyboardShortcut shortcut = UsageViewImpl.getShowUsagesWithSettingsShortcut();
    if (shortcut != null) {
      new DumbAwareAction() {
        @Override
        public void actionPerformed(AnActionEvent e) {
          popup[0].cancel();
          showDialogAndFindUsages(handler, popupPosition, editor, maxUsages);
        }
      }.registerCustomShortcutSet(new CustomShortcutSet(shortcut.getFirstKeyStroke()), table);
    }
    shortcut = getShowUsagesShortcut();
    if (shortcut != null) {
      new DumbAwareAction() {
        @Override
        public void actionPerformed(AnActionEvent e) {
          popup[0].cancel();
          searchEverywhere(options, handler, editor, popupPosition, maxUsages);
        }
View Full Code Here


    });
    final JBPopup[] popup = new JBPopup[1];

    KeyboardShortcut shortcut = UsageViewImpl.getShowUsagesWithSettingsShortcut();
    if (shortcut != null) {
      new DumbAwareAction() {
        @Override
        public void actionPerformed(AnActionEvent e) {
          popup[0].cancel();
          showDialogAndFindUsages(handler, popupPosition, editor, maxUsages);
        }
      }.registerCustomShortcutSet(new CustomShortcutSet(shortcut.getFirstKeyStroke()), table);
    }
    shortcut = getShowUsagesShortcut();
    if (shortcut != null) {
      new DumbAwareAction() {
        @Override
        public void actionPerformed(AnActionEvent e) {
          popup[0].cancel();
          searchEverywhere(options, handler, editor, popupPosition, maxUsages);
        }
View Full Code Here

public class QuickChangeCodeFormatterAction extends QuickSwitchSchemeAction {

    protected void fillActions(final Project project, DefaultActionGroup group, DataContext dataContext) {
        Settings.Formatter formatter = ProjectSettingsComponent.getInstance(project).getState().getFormatter();
        for (final Settings.Formatter lf : Settings.Formatter.values()) {
            group.add(new DumbAwareAction(lf.name(), "", lf == formatter ? ourCurrentAction : ourNotCurrentAction) {
                public void actionPerformed(AnActionEvent e) {
                    changeFormatter(project, lf);
                }
            });
        }
View Full Code Here

public class QuickChangeCodeFormatterAction extends QuickSwitchSchemeAction {

    protected void fillActions(final Project project, DefaultActionGroup group, DataContext dataContext) {
        Settings.Formatter formatter = ProjectSettingsComponent.getInstance(project).getState().getFormatter();
        for (final Settings.Formatter lf : Settings.Formatter.values()) {
            group.add(new DumbAwareAction(lf.name(), "", lf == formatter ? ourCurrentAction : ourNotCurrentAction) {
                public void actionPerformed(AnActionEvent e) {
                  changeFormatter( project, lf );
                }
            });
        }
View Full Code Here

public class QuickChangeCodeFormatterAction extends QuickSwitchSchemeAction {

    protected void fillActions(final Project project, DefaultActionGroup group, DataContext dataContext) {
        Settings.Formatter formatter = ProjectSettingsComponent.getInstance(project).getState().getFormatter();
        for (final Settings.Formatter lf : Settings.Formatter.values()) {
            group.add(new DumbAwareAction(lf.name(), "", lf == formatter ? ourCurrentAction : ourNotCurrentAction) {
                public void actionPerformed(AnActionEvent e) {
                    changeFormatter(project, lf);
                }
            });
        }
View Full Code Here

        updateLabel();
    }

    @Override
    protected void createActions(Consumer<AnAction> anActionConsumer) {
        anActionConsumer.consume(new DumbAwareAction("Base") {
            @Override
            public void actionPerformed(AnActionEvent e) {
                removeSelectedValue();
                updateLabel();
            }
View Full Code Here

    }

    private DumbAwareAction getActionForRevision(final String commitHash, final RevisionInfo revisionInfo) {
        final Pair<String, RevisionInfo> infoPair = Pair.create(commitHash, revisionInfo);
        String actionLabel = REVISION_LABEL_FUNCTION.apply(infoPair);
        return new DumbAwareAction(actionLabel) {
            @Override
            public void actionPerformed(AnActionEvent e) {
                updateSelectedValue(infoPair);
                updateLabel();
            }
View Full Code Here

        }

        @Override
        protected void createActions(Consumer<AnAction> actionConsumer) {
            for (final User user : users) {
                actionConsumer.consume(new DumbAwareAction(user.label) {
                    @Override
                    public void actionPerformed(AnActionEvent e) {
                        value = Optional.of(user);
                        myLabel.setText(user.label);
                        setChanged();
View Full Code Here

            myLabel.setText("All");
        }

        @Override
        protected void createActions(Consumer<AnAction> actionConsumer) {
            actionConsumer.consume(new DumbAwareAction("All") {
                @Override
                public void actionPerformed(AnActionEvent e) {
                    value = Optional.absent();
                    myLabel.setText("All");
                    setChanged();
                    notifyObservers(project);
                }
            });
            Iterable<GitRepository> repositories = gerritGitUtil.getRepositories(project);
            for (final GitRepository repository : repositories) {
                DefaultActionGroup group = new DefaultActionGroup();
                group.add(new Separator(getNameForRepository(repository)));
                List<GitRemoteBranch> branches = Lists.newArrayList(repository.getBranches().getRemoteBranches());
                Ordering<GitRemoteBranch> ordering = Ordering.natural().onResultOf(new Function<GitRemoteBranch, String>() {
                    @Override
                    public String apply(GitRemoteBranch branch) {
                        return branch.getNameForRemoteOperations();
                    }
                });
                Collections.sort(branches, ordering);
                for (final GitRemoteBranch branch : branches) {
                    if (!branch.getNameForRemoteOperations().equals("HEAD")) {
                        group.add(new DumbAwareAction(branch.getNameForRemoteOperations()) {
                            @Override
                            public void actionPerformed(AnActionEvent e) {
                                value = Optional.of(new BranchDescriptor(repository, branch));
                                myLabel.setText(branch.getNameForRemoteOperations());
                                setChanged();
View Full Code Here

    }

    @Nullable
    @Override
    public AnAction getClickAction() {
        return new DumbAwareAction() {
            @Override
            public void actionPerformed(AnActionEvent e) {
                MouseEvent inputEvent = (MouseEvent) e.getInputEvent();
                ActionManager actionManager = ActionManager.getInstance();
                DefaultActionGroup actionGroup = createPopupMenuActionGroup();
View Full Code Here

TOP

Related Classes of com.intellij.openapi.project.DumbAwareAction

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.