IExtension getAppExtension(String applicationId) { return extensionRegistry.getExtension(PI_RUNTIME, PT_APPLICATIONS, applicationId); }
IExtension getAppExtension(String applicationId) { return extensionRegistry.getExtension(PI_RUNTIME, PT_APPLICATIONS, applicationId); }
IExtension getAppExtension(String applicationId) { return extensionRegistry.getExtension(PI_RUNTIME, PT_APPLICATIONS, applicationId); }
public boolean supportsConfigs() { if (!supportsConfigurationsCalculated) { IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, name); if (extension != null) { IConfigurationElement[] configs = extension.getConfigurationElements(); if (configs.length != 0) { String value = configs[0].getAttribute("supportsConfigurations"); //$NON-NLS-1$ supportsConfigurations = (value != null && value.equalsIgnoreCase(Boolean.TRUE.toString())); } } supportsConfigurationsCalculated = true; } return supportsConfigurations; }
public boolean supportsConfigs() { if (!supportsConfigurationsCalculated) { IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, name); if (extension != null) { IConfigurationElement[] configs = extension.getConfigurationElements(); if (configs.length != 0) { String value = configs[0].getAttribute("supportsConfigurations"); //$NON-NLS-1$ supportsConfigurations = (value != null && value.equalsIgnoreCase(Boolean.TRUE.toString())); } } supportsConfigurationsCalculated = true; } return supportsConfigurations; }
public boolean supportsConfigs() { if (!supportsConfigurationsCalculated) { IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, name); if (extension != null) { IConfigurationElement[] configs = extension.getConfigurationElements(); if (configs.length != 0) { String value = configs[0].getAttribute("supportsConfigurations"); //$NON-NLS-1$ supportsConfigurations = (value != null && value.equalsIgnoreCase(Boolean.TRUE.toString())); } } supportsConfigurationsCalculated = true; } return supportsConfigurations; }
/** * Computes whether this build command allows configuration of its * triggers, based on information in the builder extension declaration. */ private void computeIsConfigurable() { triggers |= MASK_CONFIG_COMPUTED; IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, name); if (extension != null) { IConfigurationElement[] configs = extension.getConfigurationElements(); if (configs.length != 0) { String value = configs[0].getAttribute("isConfigurable"); //$NON-NLS-1$ setConfigurable(value != null && value.equalsIgnoreCase(Boolean.TRUE.toString())); } } }
/** * Computes whether this build command allows configuration of its * triggers, based on information in the builder extension declaration. */ private void computeIsConfigurable() { triggers |= MASK_CONFIG_COMPUTED; IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, name); if (extension != null) { IConfigurationElement[] configs = extension.getConfigurationElements(); if (configs.length != 0) { String value = configs[0].getAttribute("isConfigurable"); //$NON-NLS-1$ setConfigurable(value != null && value.equalsIgnoreCase(Boolean.TRUE.toString())); } } }
/** * Computes whether this build command allows configuration of its * triggers, based on information in the builder extension declaration. */ private void computeIsConfigurable() { triggers |= MASK_CONFIG_COMPUTED; IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, name); if (extension != null) { IConfigurationElement[] configs = extension.getConfigurationElements(); if (configs.length != 0) { String value = configs[0].getAttribute("isConfigurable"); //$NON-NLS-1$ setConfigurable(value != null && value.equalsIgnoreCase(Boolean.TRUE.toString())); } } }
@Override public synchronized ModelProvider getModelProvider() throws CoreException { if (provider == null) { IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_MODEL_PROVIDERS, id); IConfigurationElement[] elements = extension.getConfigurationElements(); for (int i = 0; i < elements.length; i++) { IConfigurationElement element = elements[i]; if (element.getName().equalsIgnoreCase("modelProvider")) { //$NON-NLS-1$ try { provider = (ModelProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ provider.init(this); } catch (ClassCastException e) { String message = NLS.bind(Messages.mapping_wrongType, id); throw new CoreException(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Platform.PLUGIN_ERROR, message, e)); } } } } return provider; }
@Override public synchronized ModelProvider getModelProvider() throws CoreException { if (provider == null) { IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_MODEL_PROVIDERS, id); IConfigurationElement[] elements = extension.getConfigurationElements(); for (IConfigurationElement element : elements) { if (element.getName().equalsIgnoreCase("modelProvider")) { //$NON-NLS-1$ try { provider = (ModelProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ provider.init(this); } catch (ClassCastException e) { String message = NLS.bind(Messages.mapping_wrongType, id); throw new CoreException(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Platform.PLUGIN_ERROR, message, e)); } } } } return provider; }
@Override public synchronized ModelProvider getModelProvider() throws CoreException { if (provider == null) { IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_MODEL_PROVIDERS, id); IConfigurationElement[] elements = extension.getConfigurationElements(); for (int i = 0; i < elements.length; i++) { IConfigurationElement element = elements[i]; if (element.getName().equalsIgnoreCase("modelProvider")) { //$NON-NLS-1$ try { provider = (ModelProvider) element.createExecutableExtension("class"); //$NON-NLS-1$ provider.init(this); } catch (ClassCastException e) { String message = NLS.bind(Messages.mapping_wrongType, id); throw new CoreException(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Platform.PLUGIN_ERROR, message, e)); } } } } return provider; }
protected IExtension[] findMatchingRepositoryExtensions(String suffix, String type) { IConfigurationElement[] elt = null; if (type != null && type.length() > 0) { IExtension ext = RegistryFactory.getRegistry().getExtension(getRepositoryProviderExtensionPointId(), type); elt = (ext != null) ? ext.getConfigurationElements() : new IConfigurationElement[0]; } else { elt = RegistryFactory.getRegistry().getConfigurationElementsFor(getRepositoryProviderExtensionPointId()); } int count = 0; for (int i = 0; i < elt.length; i++) { if (EL_FILTER.equals(elt[i].getName())) { if (!suffix.equals(elt[i].getAttribute(ATTR_SUFFIX))) { elt[i] = null; } else { count++; } } else { elt[i] = null; } } IExtension[] results = new IExtension[count]; for (int i = 0; i < elt.length; i++) { if (elt[i] != null) results[--count] = elt[i].getDeclaringExtension(); } return results; }
protected IExtension[] findMatchingRepositoryExtensions(String suffix, String type) { IConfigurationElement[] elt = null; if (type != null && type.length() > 0) { IExtension ext = RegistryFactory.getRegistry().getExtension(getRepositoryProviderExtensionPointId(), type); elt = (ext != null) ? ext.getConfigurationElements() : new IConfigurationElement[0]; } else { elt = RegistryFactory.getRegistry().getConfigurationElementsFor(getRepositoryProviderExtensionPointId()); } int count = 0; for (int i = 0; i < elt.length; i++) { if (EL_FILTER.equals(elt[i].getName())) { if (!suffix.equals(elt[i].getAttribute(ATTR_SUFFIX))) { elt[i] = null; } else { count++; } } else { elt[i] = null; } } IExtension[] results = new IExtension[count]; for (int i = 0; i < elt.length; i++) { if (elt[i] != null) results[--count] = elt[i].getDeclaringExtension(); } return results; }
public ProcessingStep create(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtension extension = registry.getExtension(PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId()); Exception error; if (extension != null) { IConfigurationElement[] config = extension.getConfigurationElements(); try { Object object = config[0].createExecutableExtension("class"); //$NON-NLS-1$ ProcessingStep step = (ProcessingStep) object; step.initialize(agent, descriptor, context); return step; } catch (Exception e) { error = e; } } else error = new ProcessingStepHandlerException(NLS.bind(Messages.cannot_get_extension, PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId())); int severity = descriptor.isRequired() ? IStatus.ERROR : IStatus.INFO; ProcessingStep result = new EmptyProcessingStep(); result.setStatus(new Status(severity, Activator.ID, Messages.cannot_instantiate_step + descriptor.getProcessorId(), error)); return result; }
public ProcessingStep create(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtension extension = registry.getExtension(PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId()); Exception error; if (extension != null) { IConfigurationElement[] config = extension.getConfigurationElements(); try { Object object = config[0].createExecutableExtension("class"); //$NON-NLS-1$ ProcessingStep step = (ProcessingStep) object; step.initialize(agent, descriptor, context); return step; } catch (Exception e) { error = e; } } else error = new ProcessingStepHandlerException(NLS.bind(Messages.cannot_get_extension, PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId())); int severity = descriptor.isRequired() ? IStatus.ERROR : IStatus.INFO; ProcessingStep result = new EmptyProcessingStep(); result.setStatus(new Status(severity, Activator.ID, Messages.cannot_instantiate_step + descriptor.getProcessorId(), error)); return result; }
public ProcessingStep create(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtension extension = registry.getExtension(PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId()); Exception error; if (extension != null) { IConfigurationElement[] config = extension.getConfigurationElements(); try { Object object = config[0].createExecutableExtension("class"); //$NON-NLS-1$ ProcessingStep step = (ProcessingStep) object; step.initialize(agent, descriptor, context); return step; } catch (Exception e) { error = e; } } else error = new ProcessingStepHandlerException(NLS.bind(Messages.cannot_get_extension, PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId())); int severity = descriptor.isRequired() ? IStatus.ERROR : IStatus.INFO; ProcessingStep result = new EmptyProcessingStep(); result.setStatus(new Status(severity, Activator.ID, Messages.cannot_instantiate_step + descriptor.getProcessorId(), error)); return result; }
public ProcessingStep create(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtension extension = registry.getExtension(PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId()); Exception error; if (extension != null) { IConfigurationElement[] config = extension.getConfigurationElements(); try { Object object = config[0].createExecutableExtension("class"); //$NON-NLS-1$ ProcessingStep step = (ProcessingStep) object; step.initialize(agent, descriptor, context); return step; } catch (Exception e) { error = e; } } else error = new ProcessingStepHandlerException(NLS.bind(Messages.cannot_get_extension, PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId())); int severity = descriptor.isRequired() ? IStatus.ERROR : IStatus.INFO; ProcessingStep result = new EmptyProcessingStep(); result.setStatus(new Status(severity, Activator.ID, Messages.cannot_instantiate_step + descriptor.getProcessorId(), error)); return result; }
/** * Instantiates and returns the builder with the given name. If the builder, its plugin, or its nature * is missing, returns null. */ private IncrementalProjectBuilder instantiateBuilder(String builderName) throws CoreException { IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, builderName); if (extension == null) return null; IConfigurationElement[] configs = extension.getConfigurationElements(); if (configs.length == 0) return null; String natureId = null; if (getBooleanAttribute(configs[0], "hasNature")) { //$NON-NLS-1$ //find the nature that owns this builder String builderId = extension.getUniqueIdentifier(); natureId = workspace.getNatureManager().findNatureForBuilder(builderId); if (natureId == null) return null; } //The nature exists, or this builder doesn't specify a nature InternalBuilder builder = (InternalBuilder) configs[0].createExecutableExtension("run"); //$NON-NLS-1$ builder.setPluginId(extension.getContributor().getName()); builder.setLabel(extension.getLabel()); builder.setNatureId(natureId); builder.setCallOnEmptyDelta(getBooleanAttribute(configs[0], "callOnEmptyDelta")); //$NON-NLS-1$ return (IncrementalProjectBuilder) builder; }
/** * Instantiates and returns the builder with the given name. If the builder, its plugin, or its nature * is missing, returns null. */ private IncrementalProjectBuilder instantiateBuilder(String builderName) throws CoreException { IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, builderName); if (extension == null) return null; IConfigurationElement[] configs = extension.getConfigurationElements(); if (configs.length == 0) return null; String natureId = null; if (getBooleanAttribute(configs[0], "hasNature")) { //$NON-NLS-1$ //find the nature that owns this builder String builderId = extension.getUniqueIdentifier(); natureId = workspace.getNatureManager().findNatureForBuilder(builderId); if (natureId == null) return null; } //The nature exists, or this builder doesn't specify a nature InternalBuilder builder = (InternalBuilder) configs[0].createExecutableExtension("run"); //$NON-NLS-1$ builder.setPluginId(extension.getContributor().getName()); builder.setLabel(extension.getLabel()); builder.setNatureId(natureId); builder.setCallOnEmptyDelta(getBooleanAttribute(configs[0], "callOnEmptyDelta")); //$NON-NLS-1$ return (IncrementalProjectBuilder) builder; }