Java 类org.eclipse.core.runtime.ContributorFactoryOSGi 实例源码

项目:gwt-eclipse-plugin    文件:BundleUtilities.java   
/**
 * Returns <code>true</code> if this bundle implements the extension point
 * with the given <code>extensionPointId</code>.
 * 
 * @param bundle the bundle to test
 * @param extensionSimpleId the simple id of the extension point
 * @param extensionPointId extension id to search for
 * 
 * @return <code>true</code> if this bundle implements the extension point
 *         with the given <code>extensionPointId</code>
 */
public static boolean contributesToExtensionPoint(Bundle bundle,
    String extensionSimpleId, String extensionPointId) {
  IExtensionRegistry registry = RegistryFactory.getRegistry();
  IContributor contributor = ContributorFactoryOSGi.createContributor(bundle);
  for (IExtension extension : registry.getExtensions(contributor.getName())) {
    if (extension.getExtensionPointUniqueIdentifier().equals(extensionPointId)) {
      if (extensionSimpleId != null
          && !extensionSimpleId.equals(extension.getSimpleIdentifier())) {
        continue;
      }

      return true;
    }
  }

  return false;
}
项目:OpenSPIFe    文件:TestJSConstraint.java   
@SuppressWarnings("restriction")
@BeforeClass
public static void setupExtensions() throws Exception {
    final IExtensionRegistry registry = Platform.getExtensionRegistry();
    Object key = ((ExtensionRegistry) registry).getTemporaryUserToken();
    Bundle bundle = Activator.getDefault().getBundle();
    IContributor contributor = ContributorFactoryOSGi.createContributor(bundle);
    InputStream inputStream = null;
    try {
        inputStream = FileLocator.openStream(bundle, new Path("datafiles/TestJSConstraintExtension.xml"), false);
        registry.addContribution(inputStream, contributor, false, null, null, key);
    } finally {
        if (inputStream != null) {
            inputStream.close();
        }
    }
    // wait until jobs kicked off by adding the contribution are complete
    DynamicExtensionUtils.waitForJobs();
}
项目:pep-tools    文件:ProjectTemplateExtensionLoader.java   
public ProjectTemplateExtensionLoader() {
    Bundle bundle = Platform.getBundle(ProjectTemplateActivator.PLUGIN_ID);
    this.contributor = ContributorFactoryOSGi.createContributor(bundle);
    this.extensionRegistry = (ExtensionRegistry) Platform.getExtensionRegistry();
    this.wizardRegistry = NewWizardRegistry.getInstance();
}
项目:idecore    文件:BaseContributionFactory.java   
public BaseContributionFactory() {
    super();
    registry = RegistryFactory.getRegistry();
    key = ((ExtensionRegistry) registry).getTemporaryUserToken();
    contributor = ContributorFactoryOSGi.createContributor(getBundle());
}