コード例 #1
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);
    }
  }
コード例 #2
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);
   }
 }