Ejemplo n.º 1
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());
   }
 }
Ejemplo n.º 2
0
 public void setRefreshVisible(final boolean visible) {
   UIUtil.invokeLaterIfNeeded(
       new Runnable() {
         @Override
         public void run() {
           myRefreshAlarm.cancelAllRequests();
           myRefreshAlarm.addRequest(
               new Runnable() {
                 @Override
                 public void run() {
                   if (visible) {
                     myRefreshIcon.resume();
                   } else {
                     myRefreshIcon.suspend();
                   }
                   myRefreshIcon.revalidate();
                   myRefreshIcon.repaint();
                 }
               },
               visible ? 100 : 300);
         }
       });
 }
Ejemplo n.º 3
0
  private void buildInProcessCount() {
    removeAll();
    setLayout(new BorderLayout());

    final JPanel progressCountPanel = new JPanel(new BorderLayout(0, 0));
    progressCountPanel.setOpaque(false);
    String processWord = myOriginals.size() == 1 ? " process" : " processes";
    final LinkLabel label =
        new LinkLabel(
            myOriginals.size() + processWord + " running...",
            null,
            new LinkListener() {
              @Override
              public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
                triggerPopupShowing();
              }
            });

    if (SystemInfo.isMac) label.setFont(UIUtil.getLabelFont().deriveFont(11.0f));

    label.setOpaque(false);

    final Wrapper labelComp = new Wrapper(label);
    labelComp.setOpaque(false);
    progressCountPanel.add(labelComp, BorderLayout.CENTER);

    // myProgressIcon.setBorder(new IdeStatusBarImpl.MacStatusBarWidgetBorder());
    progressCountPanel.add(myProgressIcon, BorderLayout.WEST);

    add(myRefreshAndInfoPanel, BorderLayout.CENTER);

    progressCountPanel.setBorder(new EmptyBorder(0, 0, 0, 4));
    add(progressCountPanel, BorderLayout.EAST);

    revalidate();
    repaint();
  }