コード例 #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.action.ContributionItem#dispose()
  */
 public void dispose() {
   if (loadedDynamicContribution != null) {
     loadedDynamicContribution.dispose();
     loadedDynamicContribution = null;
   }
   super.dispose();
 }
コード例 #2
0
  private void createContributionItem() {

    loadedDynamicContribution =
        (WorkbenchWindowControlContribution)
            Util.safeLoadExecutableExtension(
                dynamicAddition,
                IWorkbenchRegistryConstants.ATT_CLASS,
                WorkbenchWindowControlContribution.class);

    if (loadedDynamicContribution == null) {
      alreadyFailed = true;
      return;
    }

    loadedDynamicContribution.setId(getId());
    loadedDynamicContribution.setParent(getParent());
    loadedDynamicContribution.setWorkbenchWindow(getWorkbenchWindow());
    loadedDynamicContribution.setCurSide(getCurSide());
    if (loadedDynamicContribution instanceof IWorkbenchContribution) {
      ((IWorkbenchContribution) loadedDynamicContribution).initialize(locator);
    }
  }
コード例 #3
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.action.ContributionItem#isDirty()
  */
 public boolean isDirty() {
   if (loadedDynamicContribution != null) {
     return loadedDynamicContribution.isDirty();
   }
   return super.isDirty();
 }
コード例 #4
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.action.ContributionItem#isDynamic()
  */
 public boolean isDynamic() {
   if (loadedDynamicContribution != null) {
     return loadedDynamicContribution.isDynamic();
   }
   return true;
 }
コード例 #5
0
  /*
   * (non-Javadoc)
   * @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite)
   */
  public Control createControl(Composite parent) {

    WorkbenchWindowControlContribution contributionItem = getContributionItem();
    if (contributionItem != null) return contributionItem.delegateCreateControl(parent);
    return null;
  }
コード例 #6
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.ui.internal.menus.InternalControlContribution#setCurSide(int)
  */
 public void setCurSide(int curSide) {
   super.setCurSide(curSide);
   if (loadedDynamicContribution != null) {
     loadedDynamicContribution.setCurSide(curSide);
   }
 }
コード例 #7
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.ui.internal.menus.InternalControlContribution#setWorkbenchWindow
  * (org.eclipse.ui.IWorkbenchWindow)
  */
 public void setWorkbenchWindow(IWorkbenchWindow wbw) {
   super.setWorkbenchWindow(wbw);
   if (loadedDynamicContribution != null) {
     loadedDynamicContribution.setWorkbenchWindow(wbw);
   }
 }
コード例 #8
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.jface.action.ContributionItem#setParent(org.eclipse.jface
  * .action.IContributionManager)
  */
 public void setParent(IContributionManager parent) {
   super.setParent(parent);
   if (loadedDynamicContribution != null) {
     loadedDynamicContribution.setParent(parent);
   }
 }
コード例 #9
0
 public void update(String id) {
   if (loadedDynamicContribution != null) {
     loadedDynamicContribution.update(id);
   }
 }
コード例 #10
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.action.ContributionItem#update()
  */
 public void update() {
   if (loadedDynamicContribution != null) {
     loadedDynamicContribution.update();
   }
 }
コード例 #11
0
 /**
  * ************************************************************************* Dispose the control
  * ************************************************************************
  */
 @Override
 public void dispose() {
   GuiNotifications.get().removeListener(this);
   super.dispose();
 }