// todo terrible constructor
  public MultipleChangeListBrowser(
      Project project,
      List<? extends ChangeList> changeLists,
      List<Change> changes,
      Disposable parentDisposable,
      ChangeList initialListSelection,
      boolean capableOfExcludingChanges,
      boolean highlightProblems,
      Runnable rebuildListListener,
      @Nullable Runnable inclusionListener,
      AnAction... additionalActions) {
    super(
        project,
        changeLists,
        changes,
        initialListSelection,
        capableOfExcludingChanges,
        highlightProblems,
        inclusionListener,
        MyUseCase.LOCAL_CHANGES,
        null);
    myParentDisposable = parentDisposable;
    myRebuildListListener = rebuildListListener;

    myChangeListChooser = new ChangeListChooser(changeLists);
    myHeaderPanel.add(myChangeListChooser, BorderLayout.EAST);
    myShowingAllChangeLists =
        Comparing.haveEqualElements(
            changeLists, ChangeListManager.getInstance(project).getChangeLists());
    ChangeListManager.getInstance(myProject).addChangeListListener(myChangeListListener);

    myExtender = new Extender(project, this, additionalActions);

    ActionManager actionManager = ActionManager.getInstance();
    final AnAction moveAction = actionManager.getAction(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST);
    actionManager.addAnActionListener(
        new AnActionListener.Adapter() {
          @Override
          public void afterActionPerformed(
              AnAction action, DataContext dataContext, AnActionEvent event) {
            if (moveAction.equals(action)) {
              rebuildList();
            }
          }
        },
        myParentDisposable);
  }
Ejemplo n.º 2
0
 protected boolean shouldRunProgress() {
   return myLastRoots == null || !Comparing.haveEqualElements(myLastRoots, getRoots());
 }