예제 #1
0
  private void removeProgress(@NotNull InlineProgressIndicator progress) {
    synchronized (myOriginals) {
      if (!myInline2Original.containsKey(progress)) return;

      final boolean last = myOriginals.size() == 1;
      final boolean beforeLast = myOriginals.size() == 2;

      myPopup.removeIndicator(progress);

      final ProgressIndicatorEx original = removeFromMaps(progress);
      if (myOriginals.contains(original)) return;

      if (last) {
        restoreEmptyStatus();
        if (myShouldClosePopupAndOnProcessFinish) {
          hideProcessPopup();
        }
      } else {
        if (myPopup.isShowing() || myOriginals.size() > 1) {
          buildInProcessCount();
        } else if (beforeLast) {
          buildInInlineIndicator(createInlineDelegate(myInfos.get(0), myOriginals.get(0), true));
        } else {
          restoreEmptyStatus();
        }
      }

      runQuery();
    }
  }
예제 #2
0
  public void addProgress(@NotNull ProgressIndicatorEx original, @NotNull TaskInfo info) {
    synchronized (myOriginals) {
      final boolean veryFirst = !hasProgressIndicators();

      myOriginals.add(original);
      myInfos.add(info);

      final InlineProgressIndicator expanded = createInlineDelegate(info, original, false);
      final InlineProgressIndicator compact = createInlineDelegate(info, original, true);

      myPopup.addIndicator(expanded);
      myProgressIcon.resume();

      if (veryFirst && !myPopup.isShowing()) {
        buildInInlineIndicator(compact);
      } else {
        buildInProcessCount();
        if (myInfos.size() > 1 && Registry.is("ide.windowSystem.autoShowProcessPopup")) {
          openProcessPopup(false);
        }
      }

      runQuery();
    }
  }
예제 #3
0
 private void openProcessPopup(boolean requestFocus) {
   synchronized (myOriginals) {
     if (myPopup.isShowing()) return;
     if (hasProgressIndicators()) {
       myShouldClosePopupAndOnProcessFinish = true;
       buildInProcessCount();
     } else {
       myShouldClosePopupAndOnProcessFinish = false;
       restoreEmptyStatus();
     }
     myPopup.show(requestFocus);
   }
 }
예제 #4
0
  void hideProcessPopup() {
    synchronized (myOriginals) {
      if (!myPopup.isShowing()) return;

      if (myOriginals.size() == 1) {
        buildInInlineIndicator(createInlineDelegate(myInfos.get(0), myOriginals.get(0), true));
      } else if (!hasProgressIndicators()) {
        restoreEmptyStatus();
      } else {
        buildInProcessCount();
      }

      myPopup.hide();
    }
  }
예제 #5
0
 private void triggerPopupShowing() {
   if (myPopup.isShowing()) {
     hideProcessPopup();
   } else {
     openProcessPopup(true);
   }
 }
예제 #6
0
 private void handle(MouseEvent e) {
   if (UIUtil.isActionClick(e, MouseEvent.MOUSE_PRESSED)) {
     if (!myPopup.isShowing()) {
       openProcessPopup(true);
     } else {
       hideProcessPopup();
     }
   } else if (e.isPopupTrigger()) {
     ActionGroup group = (ActionGroup) ActionManager.getInstance().getAction("BackgroundTasks");
     ActionManager.getInstance()
         .createActionPopupMenu(ActionPlaces.UNKNOWN, group)
         .getComponent()
         .show(e.getComponent(), e.getX(), e.getY());
   }
 }
예제 #7
0
 public boolean isProcessWindowOpen() {
   return myPopup.isShowing();
 }