Пример #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();
 }