@Override public void initializeExtensionPoints(IProgressMonitor monitor) { if (monitor.isCanceled()) return; IExtensionPoint[] extPoints = Platform.getExtensionRegistry().getExtensionPoints(); ExtensionPoint[] extPts = new ExtensionPoint[extPoints.length]; for (int i = 0; i < extPoints.length; i++) { if (monitor.isCanceled()) return; extPts[i] = createExtensionPointAdapter(extPoints[i]); } listener.addExtensionPoints(extPts); }
private Object[] getFolderChildren(Bundle bundle, int id) { Object[] array = null; String bundleId = bundle.getSymbolicName(); switch (id) { case IBundleFolder.F_EXTENSIONS : array = Platform.getExtensionRegistry().getExtensions(bundleId); break; case IBundleFolder.F_EXTENSION_POINTS : array = Platform.getExtensionRegistry().getExtensionPoints(bundleId); break; case IBundleFolder.F_IMPORTS : array = getManifestHeaderArray(bundle, Constants.REQUIRE_BUNDLE); break; case IBundleFolder.F_LIBRARIES : array = getManifestHeaderArray(bundle, Constants.BUNDLE_CLASSPATH); break; } Object[] result = null; if (array != null && array.length > 0) { result = new Object[array.length]; for (int i = 0; i < array.length; i++) { result[i] = createAdapter(array[i], id); } } return result; } public Object getParent(Object element) {
public IPluginExtensionPoint[] findExtensionPointsForPlugin(IPluginModelBase base) { IContributor contributor = fStrategy.createContributor(base); if (contributor == null) return new IPluginExtensionPoint[0]; IExtensionPoint[] extensions = getRegistry().getExtensionPoints(fStrategy.createContributor(base)); ArrayList<PluginExtensionPoint> list = new ArrayList<>(); for (int i = 0; i < extensions.length; i++) { PluginExtensionPoint point = new PluginExtensionPoint(extensions[i]); point.setModel(getExtensionsModel(base)); point.setParent(base.getExtensions()); list.add(point); } return list.toArray(new IPluginExtensionPoint[list.size()]); }
synchronized void start(final IExtensionRegistry registry) { final IExtensionPoint[] extensionPoints; // register listener first to avoid race condition if (Object.class == clazz || IConfigurationElement.class == clazz) { registry.addListener(this); extensionPoints = registry.getExtensionPoints(); } else { registry.addListener(this, point); extensionPoints = new IExtensionPoint[]{registry.getExtensionPoint(point)}; } // safety check in case there was no matching extension point if (extensionPoints.length == 0 || null == extensionPoints[0]) { return; } final Set<IConfigurationElement> ignore = getExistingConfigurationElements(); // retrieve any matching extensions for each point for (final IExtensionPoint p : extensionPoints) { for (final IExtension e : p.getExtensions()) { insertExtension(e, ignore); } } }
/** * 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()]); }
public void _ns(CommandInterpreter ci) throws Exception { String namespace = getArgument(ci); if (namespace == null) { String[] namespaces = RegistryFactory.getRegistry().getNamespaces(); ci.println("Namespace(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ for (int i = 0; i < namespaces.length; i++) ci.println(namespaces[i]); return; } IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint[] extpts = registry.getExtensionPoints(namespace); ci.println("Extension point(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ for (int i = 0; i < extpts.length; i++) displayExtensionPoint(extpts[i], ci); if (verbose) { ci.println("\nExtension(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ IExtension[] exts = RegistryFactory.getRegistry().getExtensions(namespace); for (int j = 0; j < exts.length; j++) displayExtension(exts[j], ci, true /*full*/); } }
public void _ns(CommandInterpreter ci) throws Exception { String namespace = getArgument(ci); if (namespace == null) { String[] namespaces = RegistryFactory.getRegistry().getNamespaces(); ci.println("Namespace(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ for (int i = 0; i < namespaces.length; i++) ci.println(namespaces[i]); return; } IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint[] extpts = registry.getExtensionPoints(namespace); ci.println("Extension point(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ for (int i = 0; i < extpts.length; i++) displayExtensionPoint(extpts[i], ci); if (verbose) { ci.println("\nExtension(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ IExtension[] exts = RegistryFactory.getRegistry().getExtensions(namespace); for (int j = 0; j < exts.length; j++) displayExtension(exts[j], ci, true /*full*/); } }
public void _ns(CommandInterpreter ci) throws Exception { String namespace = getArgument(ci); if (namespace == null) { String[] namespaces = RegistryFactory.getRegistry().getNamespaces(); ci.println("Namespace(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ for (int i = 0; i < namespaces.length; i++) ci.println(namespaces[i]); return; } IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint[] extpts = registry.getExtensionPoints(namespace); ci.println("Extension point(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ for (int i = 0; i < extpts.length; i++) displayExtensionPoint(extpts[i], ci); if (verbose) { ci.println("\nExtension(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ IExtension[] exts = RegistryFactory.getRegistry().getExtensions(namespace); for (int j = 0; j < exts.length; j++) displayExtension(exts[j], ci, true /*full*/); } }
public void _ns(CommandInterpreter ci) throws Exception { String namespace = getArgument(ci); if (namespace == null) { String[] namespaces = RegistryFactory.getRegistry().getNamespaces(); ci.println("Namespace(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ for (int i = 0; i < namespaces.length; i++) ci.println(namespaces[i]); return; } IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint[] extpts = registry.getExtensionPoints(namespace); ci.println("Extension point(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ for (int i = 0; i < extpts.length; i++) displayExtensionPoint(extpts[i], ci); if (verbose) { ci.println("\nExtension(s):"); //$NON-NLS-1$ ci.println("-------------------"); //$NON-NLS-1$ IExtension[] exts = RegistryFactory.getRegistry().getExtensions(namespace); for (int j = 0; j < exts.length; j++) displayExtension(exts[j], ci, true /*full*/); } }