Пример #1
0
 @Override
 public void dispose() {
   disposeScheduleAction();
   if (headerImage != null) {
     headerImage.dispose();
   }
   if (editorBusyIndicator != null) {
     editorBusyIndicator.stop();
   }
   if (activateAction != null) {
     activateAction.dispose();
   }
   if (menuService != null) {
     if (leftToolBarManager != null) {
       menuService.releaseContributions(leftToolBarManager);
     }
     if (toolBarManager instanceof ContributionManager) {
       menuService.releaseContributions((ContributionManager) toolBarManager);
     }
   }
   if (textSupport != null) {
     textSupport.dispose();
   }
   if (messageHyperLinkListener instanceof IDisposable) {
     ((IDisposable) messageHyperLinkListener).dispose();
   }
   super.dispose();
 }
Пример #2
0
  private void dispose() {
    // this.trayItem.dispose();
    this.sharedTextColors.dispose();

    if (trayItem != null) {
      trayItem.hide();
    }

    List<IDisposable> dispList = new ArrayList<>(globalDisposables);
    Collections.reverse(dispList);
    for (IDisposable disp : dispList) {
      try {
        disp.dispose();
      } catch (Exception e) {
        log.error(e);
      }
      globalDisposables.remove(disp);
    }
  }
Пример #3
0
  /** @since 2.3 */
  public void setMessage(String message, int type, IHyperlinkListener listener) {
    if (isHeaderFormDisposed()) {
      return;
    }

    try {
      // avoid flicker of the left header toolbar
      getHeaderForm().getForm().setRedraw(false);

      Form form = getHeaderForm().getForm().getForm();
      if (message != null) {
        message = message.replace('\n', ' ');
      }
      form.setMessage(message, type, null);
      if (messageHyperLinkListener != null) {
        form.removeMessageHyperlinkListener(messageHyperLinkListener);
        if (messageHyperLinkListener instanceof IDisposable) {
          ((IDisposable) messageHyperLinkListener).dispose();
        }
      }
      if (listener != null) {
        form.addMessageHyperlinkListener(listener);
      }
      messageHyperLinkListener = listener;

      // make sure the busyLabel image is large enough to accommodate the tool bar
      if (hasLeftToolBar()) {
        BusyIndicator busyLabel = getBusyLabel();
        if (message != null && busyLabel != null) {
          setHeaderImage(busyLabel.getImage());
        } else {
          setHeaderImage(null);
        }
      }
    } finally {
      getHeaderForm().getForm().setRedraw(true);
    }
  }