public RerunAction(JComponent comp) {
   super(
       InspectionsBundle.message("inspection.action.rerun"),
       InspectionsBundle.message("inspection.action.rerun"),
       AllIcons.Actions.Rerun);
   registerCustomShortcutSet(CommonShortcuts.getRerun(), comp);
 }
 public RerunAction(JComponent comp) {
   super(
       CommonBundle.message("action.rerun"),
       AnalysisScopeBundle.message("action.rerun.dependency"),
       AllIcons.Actions.RefreshUsages);
   registerCustomShortcutSet(CommonShortcuts.getRerun(), comp);
 }
  private RepositoryChangesBrowser createRepositoryChangesBrowser(final Project project) {
    TableView<ChangeInfo> table = changeListPanel.getTable();

    RepositoryChangesBrowser repositoryChangesBrowser =
        new RepositoryChangesBrowser(
            project,
            Collections.<CommittedChangeList>emptyList(),
            Collections.<Change>emptyList(),
            null);
    repositoryChangesBrowser
        .getDiffAction()
        .registerCustomShortcutSet(CommonShortcuts.getDiff(), table);
    repositoryChangesBrowser
        .getViewer()
        .setScrollPaneBorder(IdeBorderFactory.createBorder(SideBorder.LEFT | SideBorder.TOP));

    changeListPanel.addListSelectionListener(
        new Consumer<ChangeInfo>() {
          @Override
          public void consume(ChangeInfo changeInfo) {
            changeSelected(changeInfo, project);
          }
        });
    return repositoryChangesBrowser;
  }
 private ReRunAction() {
   super(
       UsageViewBundle.message("action.rerun"),
       UsageViewBundle.message("action.description.rerun"),
       IconLoader.getIcon("/actions/refreshUsages.png"));
   registerCustomShortcutSet(CommonShortcuts.getRerun(), myRootPanel);
 }
  @Override
  protected void buildToolBar(final DefaultActionGroup toolBarGroup) {
    super.buildToolBar(toolBarGroup);

    EmptyAction.registerWithShortcutSet(
        IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST, CommonShortcuts.getMove(), myViewer);
    toolBarGroup.add(ActionManager.getInstance().getAction(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST));
  }
 public MyDeleteAction(Condition<Object[]> availableCondition) {
   super(
       CommonBundle.message("button.delete"),
       CommonBundle.message("button.delete"),
       PlatformIcons.DELETE_ICON);
   registerCustomShortcutSet(CommonShortcuts.getDelete(), myTree);
   myCondition = availableCondition;
 }
    public void addToolbarActions(final DialogWrapper dialogWrapper) {
      final Icon icon = AllIcons.Actions.Refresh;
      if (myBrowser.myChangesToDisplay == null) {
        myBrowser.addToolbarAction(
            new AnAction("Refresh Changes") {
              @Override
              public void actionPerformed(AnActionEvent e) {
                myBrowser.rebuildList();
              }

              @Override
              public void update(AnActionEvent e) {
                e.getPresentation().setIcon(icon);
              }
            });
      }
      RollbackDialogAction rollback = new RollbackDialogAction();
      EmptyAction.setupAction(rollback, IdeActions.CHANGES_VIEW_ROLLBACK, myBrowser);
      myBrowser.addToolbarAction(rollback);

      final EditSourceForDialogAction editSourceAction = new EditSourceForDialogAction(myBrowser);
      editSourceAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), myBrowser);
      myBrowser.addToolbarAction(editSourceAction);

      myBrowser.addToolbarAction(
          ActionManager.getInstance().getAction("Vcs.CheckinProjectToolbar"));

      final List<AnAction> actions =
          AdditionalLocalChangeActionsInstaller.calculateActions(
              myProject, myBrowser.getAllChanges());
      if (actions != null) {
        for (AnAction action : actions) {
          myBrowser.addToolbarAction(action);
        }
      }
      if (myAdditionalActions != null && myAdditionalActions.length > 0) {
        for (AnAction action : myAdditionalActions) {
          myBrowser.addToolbarAction(action);
        }
      }
    }
  @Override
  public void actionPerformed(@NotNull AnActionEvent e) {
    final Project project = e.getProject();
    if (project == null) return;

    if (myPopup != null && myPopup.isVisible()) return;

    final JBList list = new JBList(buildModel(project));

    EditBookmarkDescriptionAction editDescriptionAction =
        new EditBookmarkDescriptionAction(project, list);
    DefaultActionGroup actions = new DefaultActionGroup();
    actions.add(editDescriptionAction);
    actions.add(new DeleteBookmarkAction(project, list));
    actions.add(new ToggleSortBookmarksAction());
    actions.add(new MoveBookmarkUpAction(project, list));
    actions.add(new MoveBookmarkDownAction(project, list));

    myPopup =
        new MasterDetailPopupBuilder(project)
            .setList(list)
            .setDelegate(this)
            .setDetailView(new DetailViewImpl(project))
            .setDimensionServiceKey("bookmarks")
            .setAddDetailViewToEast(true)
            .setActionsGroup(actions)
            .setPopupTuner(
                new Consumer<PopupChooserBuilder>() {
                  @Override
                  public void consume(PopupChooserBuilder builder) {
                    builder.setCloseOnEnter(false).setCancelOnClickOutside(false);
                  }
                })
            .setDoneRunnable(
                new Runnable() {
                  @Override
                  public void run() {
                    myPopup.cancel();
                  }
                })
            .createMasterDetailPopup();

    new AnAction() {
      @Override
      public void actionPerformed(AnActionEvent e) {
        @SuppressWarnings("deprecation")
        Object[] values = list.getSelectedValues();
        for (Object item : values) {
          if (item instanceof BookmarkItem) {
            itemChosen((BookmarkItem) item, project, myPopup, true);
          }
        }
      }
    }.registerCustomShortcutSet(CommonShortcuts.getEditSource(), list);

    editDescriptionAction.setPopup(myPopup);
    myPopup.showCenteredInCurrentWindow(project);

    list.getEmptyText().setText("No Bookmarks");
    list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    project
        .getMessageBus()
        .connect(myPopup)
        .subscribe(
            BookmarksListener.TOPIC,
            new BookmarksListener() {
              @Override
              public void bookmarkAdded(@NotNull Bookmark b) {}

              @Override
              public void bookmarkRemoved(@NotNull Bookmark b) {}

              @Override
              public void bookmarkChanged(@NotNull Bookmark b) {}

              @Override
              public void bookmarksOrderChanged() {
                doUpdate();
              }

              private void doUpdate() {
                TreeSet selectedValues = new TreeSet(Arrays.asList(list.getSelectedValues()));
                DefaultListModel listModel = buildModel(project);
                list.setModel(listModel);
                ListSelectionModel selectionModel = list.getSelectionModel();
                for (int i = 0; i < listModel.getSize(); i++) {
                  if (selectedValues.contains(listModel.get(i))) {
                    selectionModel.addSelectionInterval(i, i);
                  }
                }
              }
            });
  }