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

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

Best Java code snippets using org.eclipse.core.runtime.IExtensionRegistry.addContribution (Showing top 8 results out of 315)

origin: org.eclipse.platform/org.eclipse.equinox.p2.discovery.compatibility

private void processDiscoveryCoreBundle(IExtensionRegistry registry) {
  // we must add a contribution from the core bundle so that we get the
  // extension point itself
  try {
    Bundle bundle = Platform.getBundle("org.eclipse.equinox.p2.discovery.compatibility"); //$NON-NLS-1$
    IContributor contributor = new RegistryContributor(bundle.getSymbolicName(), bundle.getSymbolicName(), null, null);
    try (InputStream inputStream = bundle.getEntry("plugin.xml").openStream()) { //$NON-NLS-1$
      registry.addContribution(inputStream, contributor, false, bundle.getSymbolicName(), null, token);
    }
  } catch (IOException e) {
    throw new IllegalStateException();
  }
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.discovery.compatibility

private void processBundle(IExtensionRegistry registry, Directory.Entry entry, File bundleFile) throws IOException {
  JarFile jarFile = new JarFile(bundleFile);
  jars.add(jarFile);
  ZipEntry pluginXmlEntry = jarFile.getEntry("plugin.xml"); //$NON-NLS-1$
  if (pluginXmlEntry == null) {
    throw new IOException(Messages.DiscoveryRegistryStrategy_missing_pluginxml);
  }
  IContributor contributor = new RegistryContributor(bundleFile.getName(), bundleFile.getName(), null, null);
  if (((IDynamicExtensionRegistry) registry).hasContributor(contributor)) {
    jarFile.close();
    return;
  }
  contributorToJarFile.put(contributor, bundleFile);
  contributorToDirectoryEntry.put(contributor, entry);
  ResourceBundle translationBundle = loadTranslationBundle(jarFile);
  try (InputStream inputStream = jarFile.getInputStream(pluginXmlEntry)) {
    registry.addContribution(inputStream, contributor, false, bundleFile.getPath(), translationBundle, token);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

registry.addContribution(new BufferedInputStream(is), contributor, true, input.getPath(), null, fKey);
origin: com.diffplug.spotless/spotless-eclipse-base

private void register() throws BundleException {
  IExtensionRegistry reg = RegistryFactory.getRegistry();
  Object registryUser = ((ExtensionRegistry) reg).getTemporaryUserToken();
  if (!reg.addContribution(getStreamForEntry(PLUGIN_XML), createContributor(), false, null, getPluginProperties(), registryUser)) {
    throw new BundleException("Could not add plugin: " + bundle.getSymbolicName(), BundleException.REJECTED_BY_HOOK);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

registry.addContribution(new ByteArrayInputStream(bogusDef.getBytes()), pointContributor, false, null, null, this);
  registry.addContribution(new BufferedInputStream(new FileInputStream(pxml)), contributor, false, null, null, this);
  IExtension[] extensions = registry.getExtensions(contributor);
  for (int i = 0; i < extensions.length; i++) {
origin: eclipse/acceleo

IContributor contributor = ContributorFactoryOSGi.createContributor(bundle);
if (!((IDynamicExtensionRegistry)registry).hasContributor(contributor)) {
  registry.addContribution(new ByteArrayInputStream(EMPTY_PLUGIN_XML.getBytes()),
      contributor, false, null, null, ((ExtensionRegistry)registry)
          .getTemporaryUserToken());
origin: org.eclipse.emf/org.eclipse.emf.ecore

registry.addContribution(pluginXMLInputStream, contributor, false, bundleSymbolicName, resourceBundle, null);
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore

registry.addContribution(pluginXMLInputStream, contributor, false, bundleSymbolicName, resourceBundle, null);
org.eclipse.core.runtimeIExtensionRegistryaddContribution

Javadoc

Adds to this extension registry an extension point(s), extension(s), or a combination of those described by the XML file. The information in the XML file should be supplied in the same format as the plugin.xml; in fact, Plug-in Manifest editor can be used to prepare the XML file. The top token of the contribution (normally, "plugin" or "fragment" in the Plug-in Manifest editor) is ignored by this method.

This method is an access controlled method. Proper token (master token or user token) should be passed as an argument. Two registry keys are set in the registry constructor RegistryFactory#createRegistry(org.eclipse.core.runtime.spi.RegistryStrategy,Object,Object): master token and a user token. Master token allows all operations; user token allows non-persisted registry elements to be modified.

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

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
  • getExtension
    Returns the specified extension in this extension registry, or null if there is no such extension. T
  • getExtensionPoints
    Returns all extension points supplied by the contributor, or null if there are no such extension poi
  • 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 post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Github Copilot alternatives
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