@Override public String getName() { if (fName == null && fElement != null) { fName = fElement.getName(); } return fName; } }
private IAccessRuleParticipant getDelegate() throws CoreException { if (fDelegate == null) { if (fElement.getName().equals(EnvironmentsManager.ENVIRONMENT_ELEMENT)) { fDelegate = (IAccessRuleParticipant) fElement.createExecutableExtension(EnvironmentsManager.RULE_PARTICIPANT_ELEMENT); } else { fDelegate = (IAccessRuleParticipant) fElement.createExecutableExtension("class"); //$NON-NLS-1$ } } return fDelegate; }
private static JavaEditorTextHoverDescriptor[] createDescriptors(IConfigurationElement[] elements) { List<JavaEditorTextHoverDescriptor> result= new ArrayList<>(elements.length); for (int i= 0; i < elements.length; i++) { IConfigurationElement element= elements[i]; if (HOVER_TAG.equals(element.getName())) { JavaEditorTextHoverDescriptor desc= new JavaEditorTextHoverDescriptor(element); result.add(desc); } } return result.toArray(new JavaEditorTextHoverDescriptor[result.size()]); }
private void init(IConfigurationElement element) { Assert.isTrue(ConnectionProfileManager.EXT_ELEM_PROFILE_EXTENSION .equals(element.getName())); mElement = element; mId = element.getAttribute(ATTR_ID); mName = element.getAttribute(ATTR_NAME); mProfile = element.getAttribute(ATTR_PROFILE); }
private Configuration readProvider(IConfigurationElement element) { if (!ELEM_PROVIDER.equals(element.getName())) { reportError(SecAuthMessages.unexpectedConfigElement, element.getName(), element, null); return null; } try { return (Configuration) element.createExecutableExtension(ATTR_PROVIDER_CLASS); } catch (CoreException e) { reportError(SecAuthMessages.instantiationFailed, element.getAttribute(ATTR_PROVIDER_CLASS), element, e); return null; } }
private Collection<TemplatePersistenceData> readContributedTemplates(IConfigurationElement[] extensions) throws IOException { Collection<TemplatePersistenceData> templates= new ArrayList<>(); for (int i= 0; i < extensions.length; i++) { if (extensions[i].getName().equals(TEMPLATE)) createTemplate(templates, extensions[i]); else if (extensions[i].getName().equals(INCLUDE)) { readIncludedTemplates(templates, extensions[i]); } } return templates; }
/** * Logs a registry error when the configuration element is unknown. */ private void logUnknownElement(IConfigurationElement element) { logError(element, "Unknown extension tag found: " + element.getName()); //$NON-NLS-1$ }
public static IConfigurationElement findEmitter(String id) { IConfigurationElement configurationElement[] = getAnnotationExtensions(); for (int i = 0; i < configurationElement.length; i++) { IConfigurationElement element = configurationElement[i]; String emitterId = element.getAttribute("name"); if ("emitter".equals(element.getName()) && emitterId != null && emitterId.equals(id)) return element; } return null; }
public ReferencialFileValidatorExtension(IConfigurationElement element) { if(!REF_FILE_VALIDATOR_EXTENSION.equals(element.getName())) throw new IllegalArgumentException("Extensions must be of the type \"" + REF_FILE_VALIDATOR_EXTENSION + "\"."); //$NON-NLS-1$ //$NON-NLS-2$ this.element = element; init(); }
public ExtensionPointHelper(IConfigurationElement element) throws InvalidRegistryObjectException { Assert.isLegal(element != null); fElement= element; fName= element.getName(); // see if we have a conventional 'id' attribute }
/** * Logs a registry error when the configuration element is unknown. */ protected void logUnknownElement(IConfigurationElement element) { logError(element, "Unknown extension tag found: " + element.getName());//$NON-NLS-1$ }
private static int getPriority(IConfigurationElement element) { int priority = 0; try { String prio = element.getAttribute(ATTRIB_PRIO); priority = Integer.MAX_VALUE - Integer.parseInt(prio); /* descending order: highest prio first */ } catch (Exception e) { SdkLog.warning("could not parse priority of {} extension '{}'.", EXTENSION_POINT_NAME, element.getName(), e); } return priority; }
public boolean readElement(IConfigurationElement element) { if (element.getName().equals("factoryClass")) //$NON-NLS-1$ try { factoryHolder[0] = (EMFWorkbenchContextFactory)element.createExecutableExtension("name"); //$NON-NLS-1$ return true; } catch (CoreException e) { Logger.getLogger().logError(e); } return false; } };
/* package */LinkHelperDescriptor(IConfigurationElement aConfigElement) { Assert.isNotNull(aConfigElement, "LinkHelperRegistry.Descriptor objects cannot be null."); //$NON-NLS-1$ Assert .isLegal(LINK_HELPER.equals(aConfigElement.getName()), "LinkHelperRegistry.Descriptor objects must have the name \"linkHelper\"."); //$NON-NLS-1$ configElement = aConfigElement; init(); }
/** * readElement() - parse and deal w/ an extension like: <earModuleExtension * extensionClass = "com.ibm.etools.web.plugin.WebModuleExtensionImpl"/> */ public boolean readElement(IConfigurationElement element) { if (!element.getName().equals(Descriptor.EJB_MODEL_EXTENDER)) return false; addModuleExtension(new Descriptor(element)); return true; }
private void remove(IExtension extension) { IConfigurationElement[] elements = extension.getConfigurationElements(); for (IConfigurationElement element : elements) { if (E_ENVIRONMENT_FACTORY.equals(element.getName())) { removeEnvironmentFactory(element); } } }
protected void processExtension(IExtension extension) { IConfigurationElement[] elements = extension.getConfigurationElements(); for (IConfigurationElement element : elements) { if (element.getName().equalsIgnoreCase(FILTER_ELEMENT)) { IFilterMatcherDescriptor desc = new FilterDescriptor(element); factories.put(desc.getId(), desc); } } }
public ExtensionPointHelper(IConfigurationElement element, ILog log) throws InvalidRegistryObjectException { Assert.isLegal(element != null); Assert.isLegal(log != null); fLog= log; fElement= element; fName= element.getName(); // see if we have a conventional 'id' attribute }
protected void processRemovedExtension(IExtension extension) { IConfigurationElement[] elements = extension.getConfigurationElements(); for (int i = 0; i < elements.length; i++) { IConfigurationElement element = elements[i]; if (element.getName().equalsIgnoreCase(FILTER_ELEMENT)) { IFilterMatcherDescriptor desc = new FilterDescriptor(element, false); factories.remove(desc.getId()); } } }
protected void processExtension(IExtension extension) { IConfigurationElement[] elements = extension.getConfigurationElements(); for (int i = 0; i < elements.length; i++) { IConfigurationElement element = elements[i]; if (element.getName().equalsIgnoreCase(FILTER_ELEMENT)) { IFilterMatcherDescriptor desc = new FilterDescriptor(element); factories.put(desc.getId(), desc); } } }