IConfigurationElement[] config = Platform.getExtensionRegistry() .getConfigurationElementsFor( Activator.EXTENSION_POINT_ID_MAPPER);
private void readStockThemes(Map<String, ColorTheme> themes) { IConfigurationElement[] config = Platform.getExtensionRegistry() .getConfigurationElementsFor( Activator.EXTENSION_POINT_ID_THEME); try { for (IConfigurationElement e : config) { String xml = e.getAttribute("file"); String contributorPluginId = e.getContributor().getName(); Bundle bundle = Platform.getBundle(contributorPluginId); InputStream input = (InputStream) bundle.getResource(xml) .getContent(); ParsedTheme theme = parseTheme(input, false); amendThemeEntries(theme.getTheme().getEntries()); themes.put(theme.getTheme().getName(), theme.getTheme()); } } catch (Exception e) { e.printStackTrace(); } }
private static boolean internalExtensionRegistryAvailable() throws Throwable { return org.eclipse.core.runtime.Platform.getExtensionRegistry() != null; } }
private IExtensionPoint getExtensionPoint() { IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint exPoint = registry.getExtensionPoint(extensionPoint); return exPoint; }
/** * Return the action set extension point. * * @return the action set extension point * @since 3.1 */ private IExtensionPoint getActionSetExtensionPoint() { return Platform .getExtensionRegistry().getExtensionPoint( PlatformUI.PLUGIN_ID, IWorkbenchRegistryConstants.PL_ACTION_SETS); }
/** * Connects this manager to the platform's extension registry. */ public void connect() { Platform.getExtensionRegistry().addRegistryChangeListener(this, RefactoringCore.ID_PLUGIN); }
public void stop () { Platform.getExtensionRegistry ().removeRegistryChangeListener ( this.changeListener ); } }
public boolean isEffectiveTimeSupported(final String terminologyId) { Preconditions.checkNotNull(terminologyId, "terminologyId"); //iterate through all registered terminology component extensions for (final IConfigurationElement terminology : Platform.getExtensionRegistry().getConfigurationElementsFor(TERMINOLOGY_EXTENSION_POINT_ID)) { if (terminologyId.equals(terminology.getAttribute(ID_ATTRIBUTE))) { final String supportsEffectiveTime = nullToEmpty(terminology.getAttribute(SUPPORTS_EFFECTIVE_TIME_ATTRIBUTE)); return Boolean.parseBoolean(supportsEffectiveTime); } } throw new RuntimeException("Cannot find terminology with ID: '" + terminologyId + "'."); }
public void stop() { IExtensionRegistry xregistry = Platform.getExtensionRegistry(); xregistry.removeRegistryChangeListener(instance); instance = null; } }
public String getTerminologyId(final String terminologyComponentId) { Preconditions.checkNotNull(terminologyComponentId, "Terminology component identifier argument cannot be null."); Preconditions.checkArgument(!StringUtils.isEmpty(terminologyComponentId), "Terminology component identifier argument cannot be empty string."); for (final IConfigurationElement terminologComponents : Platform.getExtensionRegistry().getConfigurationElementsFor(TERMINOLOGY_COMPONENT_EXTENSION_POINT_ID)) { if (terminologyComponentId.equals(terminologComponents.getAttribute(ID_ATTRIBUTE))) { return terminologComponents.getAttribute(TERMINOLOGY_ID_ATTRIBUTE); } } throw new IllegalArgumentException("No terminology extension has been registered for the passed in terminology component identifier: " + terminologyComponentId); }
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; }
protected void initializeVMInstallTypePageMap() { fVmInstallTypePageMap = new HashMap(10); IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(getUniqueIdentifier(), IJavaDebugUIConstants.EXTENSION_POINT_VM_INSTALL_TYPE_PAGE); IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); for (int i = 0; i < infos.length; i++) { String id = infos[i].getAttribute("vmInstallTypeID"); //$NON-NLS-1$ fVmInstallTypePageMap.put(id, infos[i]); } }
public String getTerminologyOid(final Object object) { Preconditions.checkNotNull(object, "Object argument cannot be null."); for (final IConfigurationElement element : Platform.getExtensionRegistry().getConfigurationElementsFor(REPRESENTATION_EXTENSION_POINT_ID)) { final String representationClass = element.getAttribute(CLASS_ATTRIBUTE); if (ClassUtils.isClassAssignableFrom(object.getClass(), representationClass)) { final String terminologyComponentId = element.getAttribute(TERMINOLOGY_COMPONENT_ID_ATTRIBUTE); return getTerminologyOidByTerminologyComponentId(terminologyComponentId); } } throw new IllegalArgumentException("No terminology extension has been registered for the passed in object: " + object.getClass()); }
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; }
/** * @return Returns all search pages contributed to the workbench. */ public List getSearchPageDescriptors() { if (fPageDescriptors == null) { IConfigurationElement[] elements= Platform.getExtensionRegistry().getConfigurationElementsFor(NewSearchUI.PLUGIN_ID, SEARCH_PAGE_EXTENSION_POINT); fPageDescriptors= createSearchPageDescriptors(elements); } return fPageDescriptors; }
public ForwardingDanglingReferenceResolver () { Platform.getExtensionRegistry ().addListener ( this, EXPT_DANGLING_RESOLVER ); buildCache (); }
/** * Returns descriptors for all editor association override extensions. * * @return an array with the contributed editor association overrides */ public static EditorAssociationOverrideDescriptor[] getContributedEditorAssociationOverrides() { IExtensionRegistry registry= Platform.getExtensionRegistry(); IConfigurationElement[] elements= registry.getConfigurationElementsFor(EDITOR_ASSOCIATION_OVERRIDE_EXTENSION_POINT); EditorAssociationOverrideDescriptor[] editorAssociationOverrideDescs= createDescriptors(elements); return editorAssociationOverrideDescs; }
/** * @return Returns all search pages contributed to the workbench. */ public List<SearchPageDescriptor> getSearchPageDescriptors() { if (fPageDescriptors == null) { IConfigurationElement[] elements= Platform.getExtensionRegistry().getConfigurationElementsFor(NewSearchUI.PLUGIN_ID, SEARCH_PAGE_EXTENSION_POINT); fPageDescriptors= createSearchPageDescriptors(elements); } return fPageDescriptors; }
public void start(BundleContext context) throws Exception { super.start(context); fQuickDiffExtensionRegistry= new QuickDiffExtensionsRegistry(); fSpellingEngineRegistry= new SpellingEngineRegistry(); Platform.getExtensionRegistry().addRegistryChangeListener(this, PLUGIN_ID); }
/** * Returns all Java editor text hovers contributed to the workbench. * * @return an array with the contributed text hovers */ public static JavaEditorTextHoverDescriptor[] getContributedHovers() { IExtensionRegistry registry= Platform.getExtensionRegistry(); IConfigurationElement[] elements= registry.getConfigurationElementsFor(JAVA_EDITOR_TEXT_HOVER_EXTENSION_POINT); JavaEditorTextHoverDescriptor[] hoverDescs= createDescriptors(elements); initializeFromPreferences(hoverDescs); return hoverDescs; }