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); } }
/* * (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); } }