editors = new HashMap<String, ThemePreferenceMapper>(); IConfigurationElement[] config = Platform.getExtensionRegistry() .getConfigurationElementsFor( Activator.EXTENSION_POINT_ID_MAPPER); try {
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(); } }
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); } }
private void loadElements() { fFrameworks = new HashMap(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] elements = registry.getConfigurationElementsFor(POINT_ID); for (int i = 0; i < elements.length; i++) { String id = elements[i].getAttribute(ATT_ID); if (id == null || elements[i].getAttribute(ATT_NAME) == null || elements[i].getAttribute(ATT_DELEGATE) == null) continue; fFrameworks.put(id, elements[i]); } }
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 + "'."); }
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; }
/** * @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; }
/** * 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; }
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); }
/** * @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; }
private IConfigurationElement[] getOrReadConfigurationElements() { if (this.configurationElements == null) { IExtensionRegistry registry = RegistryFactory.getRegistry(); this.configurationElements = registry.getConfigurationElementsFor(EXT_POINT_ID_URI_SCHEME_HANDLERS); } return configurationElements; }
/** * Returns descriptors for all hyperlink detector extensions. * * @return an array with the contributed hyperlink detectors */ public static HyperlinkDetectorDescriptor[] getContributedHyperlinkDetectors() { IExtensionRegistry registry= Platform.getExtensionRegistry(); IConfigurationElement[] elements= registry.getConfigurationElementsFor(HYPERLINK_DETECTORS_EXTENSION_POINT); HyperlinkDetectorDescriptor[] hyperlinkDetectorDescs= createDescriptors(elements); return hyperlinkDetectorDescs; }
/** * Returns descriptors for all hyperlink detector extensions. * * @return an array with the contributed hyperlink detectors */ public static HyperlinkDetectorTargetDescriptor[] getContributedHyperlinkDetectorTargets() { IExtensionRegistry registry= Platform.getExtensionRegistry(); IConfigurationElement[] elements= registry.getConfigurationElementsFor(HYPERLINK_DETECTOR_TARGETS_EXTENSION_POINT); HyperlinkDetectorTargetDescriptor[] hyperlinkDetectorDescs= createDescriptors(elements); return hyperlinkDetectorDescs; }
/** * @return Returns all sorters contributed to the workbench. */ public List<SorterDescriptor> getSorterDescriptors() { if (fSorterDescriptors == null) { IConfigurationElement[] elements= Platform.getExtensionRegistry().getConfigurationElementsFor(NewSearchUI.PLUGIN_ID, SORTER_EXTENSION_POINT); fSorterDescriptors= createSorterDescriptors(elements); } return fSorterDescriptors; }
private String getTerminologyAttributeValueByOid(final String attribute, final String oid) { Preconditions.checkArgument(!StringUtils.isEmpty(attribute), "Terminology extension attribute argument cannot be empty."); Preconditions.checkNotNull(oid, "Terminology OID argument cannot be null."); Preconditions.checkArgument(!StringUtils.isEmpty(oid), "Terminology OID argument cannot be empty."); for (final IConfigurationElement terminologComponents : Platform.getExtensionRegistry().getConfigurationElementsFor(TERMINOLOGY_EXTENSION_POINT_ID)) { if (oid.equals(terminologComponents.getAttribute(OID_ATTRIBUTE))) { return terminologComponents.getAttribute(attribute); } } throw new IllegalArgumentException("No terminology extension has been registered for the passed in terminology OID: " + oid); }
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 void createCandidates() { ArrayList<Object> candidates; candidates = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] elements = registry.getConfigurationElementsFor(PDEPlugin.getPluginId(), "templates"); //$NON-NLS-1$ for (IConfigurationElement element : elements) { addTemplate(element, candidates); } fCandidates = candidates.toArray(new ITemplateSection[candidates.size()]); }
/** * 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; }
/** * 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; }
/** * Load the server images. */ private static void loadServerImages() { Trace.trace(Trace.CONFIG, "->- Loading .serverImages extension point ->-"); IExtensionRegistry registry = Platform.getExtensionRegistry(); loadServerImages(registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, ServerUIPlugin.EXTENSION_SERVER_IMAGES)); ServerUIPlugin.addRegistryListener(); Trace.trace(Trace.CONFIG, "-<- Done loading .serverImages extension point -<-"); }