Tabnine Logo
IExtensionRegistry.getExtension
Code IndexAdd Tabnine to your IDE (free)

How to use
getExtension
method
in
org.eclipse.core.runtime.IExtensionRegistry

Best Java code snippets using org.eclipse.core.runtime.IExtensionRegistry.getExtension (Showing top 20 results out of 1,458)

origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.app

IExtension getAppExtension(String applicationId) {
  return extensionRegistry.getExtension(PI_RUNTIME, PT_APPLICATIONS, applicationId);
}
origin: org.eclipse.platform/org.eclipse.equinox.app

IExtension getAppExtension(String applicationId) {
  return extensionRegistry.getExtension(PI_RUNTIME, PT_APPLICATIONS, applicationId);
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.app

IExtension getAppExtension(String applicationId) {
  return extensionRegistry.getExtension(PI_RUNTIME, PT_APPLICATIONS, applicationId);
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

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;
}
origin: org.eclipse.platform/org.eclipse.core.resources

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;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

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;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

/**
 * 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()));
    }
  }
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

/**
 * 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()));
    }
  }
}
origin: org.eclipse.platform/org.eclipse.core.resources

/**
 * 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()));
    }
  }
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

@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;
}
origin: org.eclipse.platform/org.eclipse.core.resources

@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;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

@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;
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.repository

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;
}
origin: org.eclipse.equinox.p2/repository

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;
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.artifact.repository

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;
}
origin: org.eclipse.equinox.p2.artifact/repository

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;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.artifact.repository

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;
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.artifact.repository

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;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

/**
 * 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;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

/**
 * 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;
}
org.eclipse.core.runtimeIExtensionRegistrygetExtension

Javadoc

Returns the specified extension in this extension registry, or null if there is no such extension.

Popular methods of IExtensionRegistry

  • getExtensionPoint
    Returns the extension point in this extension registry with the given namespace and extension point
  • getConfigurationElementsFor
    Returns all configuration elements from the identified extension. Returns an empty array if the exte
  • addRegistryChangeListener
    Note: for new implementations consider using #addListener(IRegistryEventListener,String). Adds the g
  • removeRegistryChangeListener
    Removes the given registry change listener from this registry. Has no effect if an identical listene
  • addListener
    Adds the given listener for registry change events related to specified extension point. Once regist
  • removeListener
    Removes the given registry change listener from this registry. This method has no effect if the list
  • getExtensionPoints
    Returns all extension points supplied by the contributor, or null if there are no such extension poi
  • addContribution
    Adds to this extension registry an extension point(s), extension(s), or a combination of those descr
  • getExtensions
    Returns all extensions supplied by the contributor, or null if there are no such extensions.
  • stop
    Call this method to properly stop the registry. The method stops registry event processing and write
  • getNamespaces
    Returns all namespaces currently used by extensions and extension points in this registry. Returns a
  • getNamespaces

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Path (java.nio.file)
  • Collectors (java.util.stream)
  • JLabel (javax.swing)
  • JList (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now