private void readExtentions() { IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint point = registry.getExtensionPoint(PDECore.PLUGIN_ID, TARGET_LOC_EXTPT); if (point == null) return; IExtension[] extensions = point.getExtensions(); for (int i = 0; i < extensions.length; i++) { IConfigurationElement[] elements = extensions[i].getConfigurationElements(); for (int j = 0; j < elements.length; j++) { String type = elements[j].getAttribute(ATTR_TYPE); if (type != null) { fExtentionMap.put(type, elements[j]); } } } }
public SearchPageRegistry() { fExtensionToInstance= new HashMap<>(); fResultClassNameToExtension= new HashMap<>(); fExtensions= Platform.getExtensionRegistry().getConfigurationElementsFor(ID_EXTENSION_POINT); for (IConfigurationElement fExtension : fExtensions) { fResultClassNameToExtension.put(fExtension.getAttribute(ATTRIB_SEARCH_RESULT_CLASS), fExtension); } }
/** * Connects this manager to the platform's extension registry. */ public void connect() { Platform.getExtensionRegistry().addRegistryChangeListener(this, RefactoringCore.ID_PLUGIN); }
private void readRegistryImpl() { extensionRegistry.addRegistryChangeListener(this, namespace); IExtension[] extensions = extensionRegistry.getExtensionPoint( namespace, PT_ENVIRONMENTS).getExtensions(); for (IExtension extension : extensions) { read(extension); } }
private void loadElements() { fTargets = new HashMap(); IExtensionRegistry registry = Platform.getExtensionRegistry(); registry.addRegistryChangeListener(this); IConfigurationElement[] elements = registry.getConfigurationElementsFor("org.eclipse.pde.core.targets"); //$NON-NLS-1$ add(elements); }
/** * Loads runtime classpath extensions */ private void initializeRuntimeClasspathExtensions() { IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(LaunchingPlugin.ID_PLUGIN, ID_EXTENSION_POINT_RUNTIME_CLASSPATH_ENTRIES); IConfigurationElement[] configs= extensionPoint.getConfigurationElements(); fClasspathEntryExtensions = new HashMap<String, IConfigurationElement>(configs.length); for (int i= 0; i < configs.length; i++) { fClasspathEntryExtensions.put(configs[i].getAttribute("id"), configs[i]); //$NON-NLS-1$ } }
IConfigurationElement[] config = Platform.getExtensionRegistry() .getConfigurationElementsFor( Activator.EXTENSION_POINT_ID_MAPPER); try { for (IConfigurationElement e : config) { final Object o = e.createExecutableExtension("class"); if (o instanceof ThemePreferenceMapper) { String pluginId = e.getAttribute("pluginId"); ThemePreferenceMapper mapper = (ThemePreferenceMapper) o; mapper.setPluginId(pluginId); if (o instanceof GenericMapper) { String xml = e.getAttribute("xml"); String contributorPluginId = e.getContributor() .getName(); Bundle bundle = Platform.getBundle(contributorPluginId); InputStream input = (InputStream) bundle.getResource( xml).getContent();
private static String[] readGlobalLoadingPluginNames() { IExtensionRegistry reg = Platform.getExtensionRegistry(); IExtensionPoint exPoint = reg.getExtensionPoint(ID, "globalPluginResourceLoad"); //$NON-NLS-1$ IExtension[] extensions = exPoint.getExtensions(); String[] names = new String[extensions.length]; if (extensions.length > 0) { for (int i = 0; i < extensions.length; i++) names[i] = extensions[i].getContributor().getName(); } return names; }
private Map<String, String> createThemeAssociations() { Map<String, String> result = new HashMap<>(); IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint extPoint = registry.getExtensionPoint(E4_THEME_EXTENSION_POINT); for (IExtension e : extPoint.getExtensions()) { for (IConfigurationElement ce : e.getConfigurationElements()) { if (ce.getName().equals(ATT_THEME_ASSOCIATION)) { String themeId = ce.getAttribute(ATT_THEME_ID); String osVersion = ce.getAttribute(ATT_OS_VERSION); result.put(osVersion != null ? themeId + osVersion : themeId, ce.getAttribute(ATT_COLOR_AND_FONT_ID)); } } } return result; }
private synchronized void ensureCleanUpInitializersRegistered() { if (fCleanUpInitializerDescriptors != null) return; ArrayList<CleanUpInitializerDescriptor> result= new ArrayList<>(); IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(JavaPlugin.getPluginId(), EXTENSION_POINT_NAME); IConfigurationElement[] elements= point.getConfigurationElements(); for (int i= 0; i < elements.length; i++) { IConfigurationElement element= elements[i]; if (CLEAN_UP_INITIALIZER_CONFIGURATION_ELEMENT_NAME.equals(element.getName())) { result.add(new CleanUpInitializerDescriptor(element)); } } fCleanUpInitializerDescriptors= result.toArray(new CleanUpInitializerDescriptor[result.size()]); }
private void setupWizardPluginIDMap() { wizardPluginIDMap = new HashMap(); // get editor plugin and save it to a hash map // Note: editors extension id is different from editor id IExtensionPoint[] point = new IExtensionPoint[]{Platform.getExtensionRegistry().getExtensionPoint(ORG_ECLIPSE_UI, "exportWizards"), //$NON-NLS-1$ Platform.getExtensionRegistry().getExtensionPoint(ORG_ECLIPSE_UI, "importWizards"), //$NON-NLS-1$ Platform.getExtensionRegistry().getExtensionPoint(ORG_ECLIPSE_UI, "newWizards"), //$NON-NLS-1$ Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.wst.common.frameworks.ui", "extendableWizard")}; //$NON-NLS-1$ //$NON-NLS-2$ for (int x = 0; x < point.length; x++) { IConfigurationElement[] elements = point[x].getConfigurationElements(); for (int i = 0; i < elements.length; i++) { String wizardID = elements[i].getAttribute("id"); //$NON-NLS-1$ String pluginID = elements[i].getDeclaringExtension().getNamespace(); wizardPluginIDMap.put(wizardID, pluginID); } } }
/** * Load extensions */ private void initialize() { fConfigurations = new HashMap<>(); IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), EXTENSION_POINT_STRING_VARIABLE_PRESENTATIONS); IConfigurationElement elements[]= point.getConfigurationElements(); for (int i = 0; i < elements.length; i++) { IConfigurationElement element = elements[i]; String name= element.getAttribute(ATTR_NAME); if (name == null) { DebugUIPlugin.logErrorMessage(MessageFormat.format("String variable presentation extension missing required 'variableName' attribute: {0}", new Object[] { element.getDeclaringExtension().getLabel() })); //$NON-NLS-1$ continue; } fConfigurations.put(name, element); } }
public void stop () { Platform.getExtensionRegistry ().removeRegistryChangeListener ( this.changeListener ); } }
protected IConfigurationElement[] getExtendedConfigurationElements() { IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint exampleWizardXP = registry.getExtensionPoint(EXAMPLE_WIZARD_XP_ID); if (exampleWizardXP == null) { return new IConfigurationElement[0]; } IExtension extension = exampleWizardXP.getExtension(getWizardExtensionId()); if (extension != null) { return extension.getConfigurationElements(); } IConfigurationElement[] exampleWizardCEs = exampleWizardXP.getConfigurationElements(); return exampleWizardCEs; }
/** * Loads adapters registered with the adapters extension point from * the plug-in registry. Note that the actual factory implementations * are loaded lazily as they are needed. */ public boolean addFactories(AdapterManager adapterManager) { IExtensionPoint point = RegistryFactory.getRegistry().getExtensionPoint(ADAPTER_POINT_ID); if (point == null) return false; boolean factoriesAdded = false; IExtension[] extensions = point.getExtensions(); for (int i = 0; i < extensions.length; i++) { IConfigurationElement[] elements = extensions[i].getConfigurationElements(); for (int j = 0; j < elements.length; j++) { AdapterFactoryProxy proxy = AdapterFactoryProxy.createProxy(elements[j]); if (proxy != null) { adapterManager.registerFactory(proxy, proxy.getAdaptableType()); factoriesAdded = true; } } } RegistryFactory.getRegistry().addListener(this, ADAPTER_POINT_ID); return factoriesAdded; }
private static IExtension[] getPerspectiveExtensions() { IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(PlatformUI.PLUGIN_ID, IWorkbenchRegistryConstants.PL_PERSPECTIVE_EXTENSIONS); if (point == null) { return null; } IExtension[] extensions = point.getExtensions(); extensions = RegistryReader.orderExtensions(extensions); return extensions; }
private IConfigurationElement[] loadElements() { IExtensionPoint point = Platform.getExtensionRegistry() .getExtensionPoint("org.eclipse.ui", "installationPages"); //$NON-NLS-1$ //$NON-NLS-2$ return point.getConfigurationElements(); }
private static synchronized Set<DelegateCommandHandlerDescriptor> getDelegateCommandHandlerDescriptors() { if (fgContributedCommandHandlers == null) { IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID); fgContributedCommandHandlers = Stream.of(elements).map(e -> new DelegateCommandHandlerDescriptor(e)).collect(Collectors.toSet()); } return fgContributedCommandHandlers; }
public ForwardingDanglingReferenceResolver () { Platform.getExtensionRegistry ().addListener ( this, EXPT_DANGLING_RESOLVER ); buildCache (); }
public Bundle getExtensionPointBundle(IExtension extension) { IExtensionRegistry registry = getExtensionRegistry(); String extensionPtId = extension.getExtensionPointUniqueIdentifier(); IExtensionPoint extensionPt = registry.getExtensionPoint(extensionPtId); IContributor contributor = extensionPt.getContributor(); return getBundle(contributor); }