Beispiel #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();
 }
Beispiel #2
0
  @Override
  public void showBusy(boolean busy) {
    if (editorBusyIndicator != null) {
      if (busy) {
        if (TasksUiInternal.isAnimationsEnabled()) {
          editorBusyIndicator.start();
        }
      } else {
        editorBusyIndicator.stop();
      }
    }

    if (!isHeaderFormDisposed()) {
      Form form = getHeaderForm().getForm().getForm();
      if (form != null && !form.isDisposed()) {
        // TODO consider only disabling certain actions
        IToolBarManager toolBarManager = form.getToolBarManager();
        if (toolBarManager instanceof ToolBarManager) {
          ToolBar control = ((ToolBarManager) toolBarManager).getControl();
          if (control != null) {
            control.setEnabled(!busy);
          }
        }

        if (leftToolBar != null) {
          leftToolBar.setEnabled(!busy);
        }
        if (titleLabel != null) {
          titleLabel.setEnabled(!busy);
        }

        CommonUiUtil.setEnabled(form.getBody(), !busy);
        for (IFormPage page : getPages()) {
          if (page instanceof WorkbenchPart) {
            WorkbenchPart part = (WorkbenchPart) page;
            part.showBusy(busy);
          }
        }
      }
    }
  }