public IPluginModelBase findExtensionPointPlugin(String pointId) { IExtensionPoint point = getExtensionPoint(pointId); if (point == null) { return null; } IContributor contributor = point.getContributor(); return getPlugin(contributor, true); }
public Bundle getExtensionPointBundle(IExtension extension) { IExtensionRegistry registry = getExtensionRegistry(); String extensionPtId = extension.getExtensionPointUniqueIdentifier(); IExtensionPoint extensionPt = registry.getExtensionPoint(extensionPtId); IContributor contributor = extensionPt.getContributor(); return getBundle(contributor); }
public Bundle getExtensionPointBundle(IExtension extension) { IExtensionRegistry registry = getExtensionRegistry(); String extensionPtId = extension.getExtensionPointUniqueIdentifier(); IExtensionPoint extensionPt = registry.getExtensionPoint(extensionPtId); IContributor contributor = extensionPt.getContributor(); return getBundle(contributor); }
public Bundle getExtensionPointBundle(IExtension extension) { IExtensionRegistry registry = getExtensionRegistry(); String extensionPtId = extension.getExtensionPointUniqueIdentifier(); IExtensionPoint extensionPt = registry.getExtensionPoint(extensionPtId); IContributor contributor = extensionPt.getContributor(); return getBundle(contributor); }
private void displayExtensionPoint(IExtensionPoint extentionPoint, CommandInterpreter ci) { if (extentionPoint == null) return; ci.println(extentionPoint.getUniqueIdentifier() + " [from " + extentionPoint.getContributor().getName() + ']'); //$NON-NLS-1$ }
private void displayExtensionPoint(IExtensionPoint extentionPoint, CommandInterpreter ci) { if (extentionPoint == null) return; ci.println(extentionPoint.getUniqueIdentifier() + " [from " + extentionPoint.getContributor().getName() + ']'); //$NON-NLS-1$ }
private void displayExtensionPoint(IExtensionPoint extentionPoint, CommandInterpreter ci) { if (extentionPoint == null) return; ci.println(extentionPoint.getUniqueIdentifier() + " [from " + extentionPoint.getContributor().getName() + ']'); //$NON-NLS-1$ }
private void displayExtensionPoint(IExtensionPoint extentionPoint, CommandInterpreter ci) { if (extentionPoint == null) return; ci.println(extentionPoint.getUniqueIdentifier() + " [from " + extentionPoint.getContributor().getName() + ']'); //$NON-NLS-1$ }
public IPluginExtensionPoint findExtensionPoint(String pointId) { IExtensionPoint extPoint = getExtensionPoint(pointId); if (extPoint != null) { IPluginModelBase model = getPlugin(extPoint.getContributor(), true); if (model != null) { IPluginExtensionPoint[] points = model.getPluginBase().getExtensionPoints(); for (int i = 0; i < points.length; i++) { IPluginExtensionPoint point = points[i]; if (points[i].getFullId().equals(pointId)) { return point; } } } } return null; }
/** * Acessor for the currently registed ExtensionPoints * @return array of ExtensionPoints */ public ExtensionPoint[] getExtensionPoints() { IExtensionPoint[] eclipseExPoint = RegistryFactory.getRegistry().getExtensionPoints(); List elms = new ArrayList(); for( int i=0; i<eclipseExPoint.length; i++) { Plugin plugin = new Plugin(eclipseExPoint[i].getContributor().getName(),"","","",null); try { Bundle bundle = Platform.getBundle(eclipseExPoint[i].getContributor().getName()); ExtensionPoint exPoint = new ExtensionPoint(eclipseExPoint[i].getUniqueIdentifier(),eclipseExPoint[i].getLabel(),bundle.getResource(eclipseExPoint[i].getSchemaReference()),plugin); for( int e=0; e<eclipseExPoint[i].getExtensions().length; e++) { Extension ex = new Extension(exPoint, plugin); configurationElement(ex,eclipseExPoint[i].getExtensions()[e].getConfigurationElements(),null); exPoint.addExtension(ex); } elms.add(exPoint); } catch (InvalidRegistryObjectException e) { //LOG } } return (ExtensionPoint[]) elms.toArray(new IExtensionPoint[elms.size()]); }
private ExtensionPoint createExtensionPointAdapter(IExtensionPoint extensionPoint) { ExtensionPoint adapter = new ExtensionPoint(); adapter.setLabel(extensionPoint.getLabel()); adapter.setUniqueIdentifier(extensionPoint.getUniqueIdentifier()); adapter.setNamespaceIdentifier(extensionPoint.getNamespaceIdentifier()); adapter.setContributor(getBundleId(extensionPoint.getContributor().getName())); Extension[] extensions = createExtensionAdapters(extensionPoint.getExtensions()); adapter.getExtensions().addAll(Arrays.asList(extensions)); return adapter; }
@Override public void registryChanged(final IRegistryChangeEvent event) { Display display = Display.getDefault(); if (part != null) { display = part.getSite().getPage().getWorkbenchWindow().getWorkbench().getDisplay(); } //check the delta to see if there are any viewer contribution changes. if so, null our builder to cause reparsing on the next menu show IExtensionDelta [] deltas = event.getExtensionDeltas(); for (IExtensionDelta delta : deltas) { IExtensionPoint extensionPoint = delta.getExtensionPoint(); if (extensionPoint.getContributor().getName().equals(WorkbenchPlugin.PI_WORKBENCH) && extensionPoint.getSimpleIdentifier().equals( IWorkbenchRegistryConstants.PL_POPUP_MENU)) { boolean clearPopups = false; IConfigurationElement [] elements = delta.getExtension().getConfigurationElements(); for (IConfigurationElement element : elements) { if (element.getName().equals(IWorkbenchRegistryConstants.TAG_VIEWER_CONTRIBUTION)) { clearPopups = true; break; } } if (clearPopups) { display.syncExec(() -> clearStaticActions()); } } } }
/** * Acessor for the ExtensionPoint * @param id the unique id of the extension point * @return null if the ExtensionPoint is not registered */ public ExtensionPoint getExtensionPoint(String id) { IExtensionPoint eclipseExPoint = RegistryFactory.getRegistry().getExtensionPoint(id); Plugin plugin = new Plugin(eclipseExPoint.getContributor().getName(),"","","",null); Bundle bundle = Platform.getBundle(eclipseExPoint.getContributor().getName()); try { ExtensionPoint exPoint = new ExtensionPoint(eclipseExPoint.getUniqueIdentifier(),eclipseExPoint.getLabel(),bundle.getResource(eclipseExPoint.getSchemaReference()),plugin); for( int e=0; e<eclipseExPoint.getExtensions().length; e++) { Plugin pluginEx = new Plugin(eclipseExPoint.getExtensions()[e].getContributor().getName(),"","","",null); Extension ex = new Extension(exPoint, pluginEx); configurationElement(ex,eclipseExPoint.getExtensions()[e].getConfigurationElements(),null); exPoint.addExtension(ex); } return exPoint; } catch (InvalidRegistryObjectException e) { //LOG } return null; }