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

项目:n4js    文件:TesterRegistry.java   
/**
 * Reads information from extensions defined in plugin.xml files.
 */
private void initialize() {
    if (isInitialized)
        throw new IllegalStateException("may invoke method initialize() only once");
    isInitialized = true;

    final IExtensionRegistry registry = RegistryFactory.getRegistry();
    if (registry != null) {
        final IConfigurationElement[] configElems = registry
                .getConfigurationElementsFor(TESTERS_EXTENSION_POINT_ID);

        for (IConfigurationElement elem : configElems) {
            try {
                final EclipseTesterDescriptor descriptor = new EclipseTesterDescriptor(elem);
                injector.injectMembers(descriptor);
                register(descriptor);
            } catch (Exception ex) {
                log.error("Error while reading extensions for extension point " + TESTERS_EXTENSION_POINT_ID, ex);
            }
        }
    }
}
项目:n4js    文件:RunnerRegistry.java   
/**
 * Reads information from extensions defined in plugin.xml files.
 */
private void initialize() {
    if (isInitialized)
        throw new IllegalStateException("may invoke method initialize() only once");
    isInitialized = true;

    final IExtensionRegistry registry = RegistryFactory.getRegistry();
    if (registry != null) {
        final IConfigurationElement[] configElems = registry
                .getConfigurationElementsFor(RUNNERS_EXTENSION_POINT_ID);

        for (IConfigurationElement elem : configElems) {
            try {
                final EclipseRunnerDescriptor descriptor = new EclipseRunnerDescriptor(elem);
                injector.injectMembers(descriptor);
                register(descriptor);
            } catch (Exception ex) {
                log.error("Error while reading extensions for extension point " + RUNNERS_EXTENSION_POINT_ID, ex);
            }
        }
    }
}
项目:gemoc-studio-modeldebugging    文件:Activator.java   
/**
 * Retrieve all the locators registered with the extension point, and additionally store them in a cache.
 * 
 * @return All locators registered with the extension point.
 */
public List<ILocator> retrieveLocators() {
    if (locators == null) {
        IExtensionRegistry reg = Platform.getExtensionRegistry();
        IExtensionPoint ep = reg.getExtensionPoint("org.eclipse.gemoc.dsl.debug.locator");
        IExtension[] extensions = ep.getExtensions();
        ArrayList<ILocator> contributors = new ArrayList<ILocator>();
        for (int i = 0; i < extensions.length; i++) {
            IExtension ext = extensions[i];
            IConfigurationElement[] ce = ext.getConfigurationElements();
            for (int j = 0; j < ce.length; j++) {
                ILocator locator;
                try {
                    locator = (ILocator)ce[j].createExecutableExtension("class");
                    contributors.add(locator);
                } catch (CoreException e) {
                    e.printStackTrace();
                }
            }
        }
        locators = contributors;
    }
    return locators;
}
项目:codelens-eclipse    文件:CodeLensProviderRegistry.java   
/**
 * Load the SourceMap language supports.
 */
private synchronized void loadCodeLensProviders() {
    if (codeLensProviderLoaded) {
        return;
    }

    try {
        IExtensionRegistry registry = Platform.getExtensionRegistry();
        if (registry == null) {
            return;
        }
        IConfigurationElement[] cf = registry.getConfigurationElementsFor(CodeLensPlugin.PLUGIN_ID,
                EXTENSION_CODELENS_PROVIDERS);
        loadCodeLensProvidersFromExtension(cf);
    } finally {
        codeLensProviderLoaded = true;
    }
}
项目:codelens-eclipse    文件:CodeLensControllerRegistry.java   
/**
 * Load the SourceMap language supports.
 */
private synchronized void loadFactories() {
    if (loaded) {
        return;
    }

    try {
        IExtensionRegistry registry = Platform.getExtensionRegistry();
        if (registry == null) {
            return;
        }
        IConfigurationElement[] cf = registry.getConfigurationElementsFor(CodeLensEditorPlugin.PLUGIN_ID,
                EXTENSION_CODELENS_CONTROLLER_FACTORIES);
        loadCodeLensProvidersFromExtension(cf);
    } finally {
        loaded = true;
    }
}
项目:gemoc-studio    文件:AbstractNewProjectWizardWithTemplates.java   
public ElementList getAvailableCodegenWizards() {
    ElementList wizards = new ElementList("CodegenWizards"); //$NON-NLS-1$
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IExtensionPoint point = registry.getExtensionPoint(org.eclipse.gemoc.commons.eclipse.pde.Activator.PLUGIN_ID, PLUGIN_POINT);
    if (point == null)
        return wizards;
    IExtension[] extensions = point.getExtensions();
    for (int i = 0; i < extensions.length; i++) {
        IConfigurationElement[] elements = extensions[i].getConfigurationElements();
        for (int j = 0; j < elements.length; j++) {
            if (elements[j].getName().equals(TAG_WIZARD)) {
                String targetPluginId = elements[j].getAttribute(WizardElement.ATT_TARGETPLUGINID);
                if( targetPluginId == null || targetPluginId.equals(getTargetPluginId())){
                    WizardElement element = createWizardElement(elements[j]);
                    if (element != null) {
                        wizards.add(element);
                    }
                }
            }
        }
    }
    return wizards;
}
项目:egradle    文件:VariablesProviderRegistry.java   
public VariablesProviderRegistry() {

    List<VariableProvider> variableProviders=new ArrayList<>();

    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] config = registry.getConfigurationElementsFor(VARIABLE_PROVIDER_ID);
    try {
        for (IConfigurationElement e : config) {
            final Object o = e.createExecutableExtension("class");
            if (o instanceof VariableProvider) {
                VariableProvider provider = (VariableProvider) o;
                variableProviders.add(provider);
            }
        }

    } catch (CoreException ex) {
        EclipseUtil.logError("Was not able to initialize variable providers registry", ex);
    }

    providers = Collections.unmodifiableList(variableProviders);

}
项目:DarwinSPL    文件:HyexpressionEclipseProxy.java   
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
    if (Platform.isRunning()) {
        // find default load option providers
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
        for (IConfigurationElement element : configurationElements) {
            try {
                eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionOptionProvider provider = (eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionOptionProvider) element.createExecutableExtension("class");
                final Map<?, ?> options = provider.getOptions();
                final Collection<?> keys = options.keySet();
                for (Object key : keys) {
                    eu.hyvar.feature.expression.resource.hyexpression.util.HyexpressionMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
                }
            } catch (CoreException ce) {
                new eu.hyvar.feature.expression.resource.hyexpression.util.HyexpressionRuntimeUtil().logError("Exception while getting default options.", ce);
            }
        }
    }
}
项目:DarwinSPL    文件:HymanifestEclipseProxy.java   
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
    if (Platform.isRunning()) {
        // find default load option providers
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.mspl.manifest.resource.hymanifest.mopp.HymanifestPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
        for (IConfigurationElement element : configurationElements) {
            try {
                eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestOptionProvider provider = (eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestOptionProvider) element.createExecutableExtension("class");
                final Map<?, ?> options = provider.getOptions();
                final Collection<?> keys = options.keySet();
                for (Object key : keys) {
                    eu.hyvar.mspl.manifest.resource.hymanifest.util.HymanifestMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
                }
            } catch (CoreException ce) {
                new eu.hyvar.mspl.manifest.resource.hymanifest.util.HymanifestRuntimeUtil().logError("Exception while getting default options.", ce);
            }
        }
    }
}
项目:DarwinSPL    文件:HymappingEclipseProxy.java   
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
    if (Platform.isRunning()) {
        // find default load option providers
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.feature.mapping.resource.hymapping.mopp.HymappingPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
        for (IConfigurationElement element : configurationElements) {
            try {
                eu.hyvar.feature.mapping.resource.hymapping.IHymappingOptionProvider provider = (eu.hyvar.feature.mapping.resource.hymapping.IHymappingOptionProvider) element.createExecutableExtension("class");
                final Map<?, ?> options = provider.getOptions();
                final Collection<?> keys = options.keySet();
                for (Object key : keys) {
                    eu.hyvar.feature.mapping.resource.hymapping.util.HymappingMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
                }
            } catch (CoreException ce) {
                new eu.hyvar.feature.mapping.resource.hymapping.util.HymappingRuntimeUtil().logError("Exception while getting default options.", ce);
            }
        }
    }
}
项目:DarwinSPL    文件:HyconstraintsEclipseProxy.java   
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
    if (Platform.isRunning()) {
        // find default load option providers
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.feature.constraint.resource.hyconstraints.mopp.HyconstraintsPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
        for (IConfigurationElement element : configurationElements) {
            try {
                eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsOptionProvider provider = (eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsOptionProvider) element.createExecutableExtension("class");
                final Map<?, ?> options = provider.getOptions();
                final Collection<?> keys = options.keySet();
                for (Object key : keys) {
                    eu.hyvar.feature.constraint.resource.hyconstraints.util.HyconstraintsMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
                }
            } catch (CoreException ce) {
                new eu.hyvar.feature.constraint.resource.hyconstraints.util.HyconstraintsRuntimeUtil().logError("Exception while getting default options.", ce);
            }
        }
    }
}
项目:DarwinSPL    文件:HyvalidityformulaEclipseProxy.java   
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
    if (Platform.isRunning()) {
        // find default load option providers
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.context.contextValidity.resource.hyvalidityformula.mopp.HyvalidityformulaPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
        for (IConfigurationElement element : configurationElements) {
            try {
                eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaOptionProvider provider = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaOptionProvider) element.createExecutableExtension("class");
                final Map<?, ?> options = provider.getOptions();
                final Collection<?> keys = options.keySet();
                for (Object key : keys) {
                    eu.hyvar.context.contextValidity.resource.hyvalidityformula.util.HyvalidityformulaMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
                }
            } catch (CoreException ce) {
                new eu.hyvar.context.contextValidity.resource.hyvalidityformula.util.HyvalidityformulaRuntimeUtil().logError("Exception while getting default options.", ce);
            }
        }
    }
}
项目:DarwinSPL    文件:HydatavalueEclipseProxy.java   
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
    if (Platform.isRunning()) {
        // find default load option providers
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.dataValues.resource.hydatavalue.mopp.HydatavaluePlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
        for (IConfigurationElement element : configurationElements) {
            try {
                eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueOptionProvider provider = (eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueOptionProvider) element.createExecutableExtension("class");
                final Map<?, ?> options = provider.getOptions();
                final Collection<?> keys = options.keySet();
                for (Object key : keys) {
                    eu.hyvar.dataValues.resource.hydatavalue.util.HydatavalueMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
                }
            } catch (CoreException ce) {
                new eu.hyvar.dataValues.resource.hydatavalue.util.HydatavalueRuntimeUtil().logError("Exception while getting default options.", ce);
            }
        }
    }
}
项目:DarwinSPL    文件:DwprofileEclipseProxy.java   
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
    if (Platform.isRunning()) {
        // find default load option providers
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(de.darwinspl.preferences.resource.dwprofile.mopp.DwprofilePlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
        for (IConfigurationElement element : configurationElements) {
            try {
                de.darwinspl.preferences.resource.dwprofile.IDwprofileOptionProvider provider = (de.darwinspl.preferences.resource.dwprofile.IDwprofileOptionProvider) element.createExecutableExtension("class");
                final Map<?, ?> options = provider.getOptions();
                final Collection<?> keys = options.keySet();
                for (Object key : keys) {
                    de.darwinspl.preferences.resource.dwprofile.util.DwprofileMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
                }
            } catch (CoreException ce) {
                new de.darwinspl.preferences.resource.dwprofile.util.DwprofileRuntimeUtil().logError("Exception while getting default options.", ce);
            }
        }
    }
}
项目:team-explorer-everywhere    文件:ExtensionPointPolicyLoader.java   
/**
 * Gets the configuration elements for the plugins that extend our checkin
 * policy extension point.
 *
 * @return an array of configuration elements from plugins that support our
 *         extension point.
 */
private IConfigurationElement[] getConfigurationElementsForCheckinPolicy() {
    final IExtensionRegistry registry = Platform.getExtensionRegistry();

    final IExtensionPoint extensionPoint = registry.getExtensionPoint(CHECKIN_POLICY_EXTENSION_POINT_NAME);

    /*
     * These extension points should always be available even if there are
     * no contributions available (policy implementations), but it's good to
     * check anyway.
     */
    if (extensionPoint == null) {
        final String messageFormat = "Couldn't load extension point {0}"; //$NON-NLS-1$
        final String message = MessageFormat.format(messageFormat, CHECKIN_POLICY_EXTENSION_POINT_NAME);
        log.error(message);
        throw new PolicyLoaderException(message, null);
    }

    return extensionPoint.getConfigurationElements();
}
项目:team-explorer-everywhere    文件:ResourceChangingCommandUtil.java   
/**
 * Returns a {@link SingleListenerFacade} of the resource changing listeners
 * by loading extension points and creating new listeners on demand.
 * Subsequent calls will used cached listener data.
 *
 * @return A {@link SingleListenerFacade} of
 *         {@link ResourceChangingCommandListener}s.
 */
public static SingleListenerFacade getListener() {
    synchronized (lock) {
        if (listener == null) {
            final IExtensionRegistry registry = Platform.getExtensionRegistry();
            final IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_POINT_ID);

            final IConfigurationElement[] elements = extensionPoint.getConfigurationElements();

            final ListenerList list = new StandardListenerList();

            for (int i = 0; i < elements.length; i++) {
                try {
                    list.addListener(elements[i].createExecutableExtension("class")); //$NON-NLS-1$
                } catch (final CoreException e) {
                    log.warn("Could not create " + EXTENSION_POINT_ID + " class", e); //$NON-NLS-1$ //$NON-NLS-2$
                }
            }

            listener = new SingleListenerFacade(ResourceChangingCommandListener.class, list);
        }

        return listener;
    }
}
项目:subclipse    文件:AdapterManager.java   
public synchronized Map getClientWrappers() {
    if (clients == null) {
        clients = new HashMap();
        IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
        IConfigurationElement[] configurationElements = pluginRegistry.getConfigurationElementsFor("org.tigris.subversion.clientadapter.wrapper");
        for (int i = 0; i < configurationElements.length; i++) {
            IConfigurationElement configurationElement = configurationElements[i];
            try {
                ISVNClientWrapper client = (ISVNClientWrapper)configurationElement.createExecutableExtension("class");
                client.setDisplayName(configurationElement.getAttribute("name"));
                clients.put(client.getAdapterID(), client);
            } catch(Exception e) {
            }
        }   
    }
    return clients;
}
项目:subclipse    文件:SVNUIPlugin.java   
public static WorkspaceAction[] getMergeProviders() throws Exception {
    if (mergeProviders == null) {
        ArrayList mergeProviderList = new ArrayList();
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement[] configurationElements = extensionRegistry.getConfigurationElementsFor(MERGE_PROVIDERS);
        for (int i = 0; i < configurationElements.length; i++) {
            IConfigurationElement configurationElement = configurationElements[i];
            WorkspaceAction mergeProvider = (WorkspaceAction)configurationElement.createExecutableExtension("class"); //$NON-NLS-1$
            mergeProvider.setName(configurationElement.getAttribute("name")); //$NON-NLS-1$
            mergeProviderList.add(mergeProvider);
        }
        mergeProviders = new WorkspaceAction[mergeProviderList.size()];
        mergeProviderList.toArray(mergeProviders);
    }
    return mergeProviders;
}
项目:subclipse    文件:SVNUIPlugin.java   
public static ISVNRepositorySourceProvider[] getRepositorySourceProviders() throws Exception {
    if (repositorySourceProviders == null) {
        List<ISVNRepositorySourceProvider> repositorySourceProviderList = new ArrayList<ISVNRepositorySourceProvider>();
        IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        IConfigurationElement[] configurationElements = extensionRegistry.getConfigurationElementsFor(REPOSITORY_SOURCE_PROVIDERS);
        for (int i = 0; i < configurationElements.length; i++) {
            IConfigurationElement configurationElement = configurationElements[i];
            ISVNRepositorySourceProvider repositorySourceProvider = (ISVNRepositorySourceProvider)configurationElement.createExecutableExtension("class"); //$NON-NLS-1$
            repositorySourceProvider.setId(configurationElement.getAttribute("id")); //$NON-NLS-1$
            repositorySourceProviderList.add(repositorySourceProvider);
        }
        repositorySourceProviders = new ISVNRepositorySourceProvider[repositorySourceProviderList.size()];
        repositorySourceProviderList.toArray(repositorySourceProviders);
        Arrays.sort(repositorySourceProviders, new Comparator<ISVNRepositorySourceProvider>() {
            public int compare(ISVNRepositorySourceProvider o1, ISVNRepositorySourceProvider o2) {
                return o1.getName().compareTo(o2.getName());
            }       
        });
    }
    return repositorySourceProviders;
}
项目:google-cloud-eclipse    文件:BasePluginXmlTest.java   
@Test
public final void testValidExtensionPoints() {
  NodeList extensions = getDocument().getElementsByTagName("extension");
  Assert.assertTrue(
      "plugin.xml must contain at least one extension point", extensions.getLength() > 0);

  IExtensionRegistry registry = RegistryFactory.getRegistry();
  Assert.assertNotNull("Make sure you're running this as a plugin test", registry);
  for (int i = 0; i < extensions.getLength(); i++) {
    Element extension = (Element) extensions.item(i);
    String point = extension.getAttribute("point");
    Assert.assertNotNull("Could not load " + extension.getAttribute("id"), point);
    IExtensionPoint extensionPoint = registry.getExtensionPoint(point);
    Assert.assertNotNull("Could not load " + extension.getAttribute("id"), extensionPoint);
  }
}
项目:ermasterr    文件:ExtendPopupMenu.java   
/**
 * plugin.xmlからタグを読み込む.
 * 
 * @throws CoreException
 * @throws CoreException
 */
public static List<ExtendPopupMenu> loadExtensions(final ERDiagramEditor editor) throws CoreException {
    final List<ExtendPopupMenu> extendPopupMenuList = new ArrayList<ExtendPopupMenu>();

    final IExtensionRegistry registry = Platform.getExtensionRegistry();
    final IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_POINT_ID);

    if (extensionPoint != null) {
        for (final IExtension extension : extensionPoint.getExtensions()) {
            for (final IConfigurationElement configurationElement : extension.getConfigurationElements()) {

                final ExtendPopupMenu extendPopupMenu = ExtendPopupMenu.createExtendPopupMenu(configurationElement, editor);

                if (extendPopupMenu != null) {
                    extendPopupMenuList.add(extendPopupMenu);
                }
            }
        }
    }

    return extendPopupMenuList;
}
项目:ermaster-k    文件:ExtendPopupMenu.java   
/**
 * plugin.xmlからタグを読み込む.
 * 
 * @throws CoreException
 * 
 * @throws CoreException
 */
public static List<ExtendPopupMenu> loadExtensions(ERDiagramEditor editor)
        throws CoreException {
    List<ExtendPopupMenu> extendPopupMenuList = new ArrayList<ExtendPopupMenu>();

    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IExtensionPoint extensionPoint = registry
            .getExtensionPoint(EXTENSION_POINT_ID);

    if (extensionPoint != null) {
        for (IExtension extension : extensionPoint.getExtensions()) {
            for (IConfigurationElement configurationElement : extension
                    .getConfigurationElements()) {

                ExtendPopupMenu extendPopupMenu = ExtendPopupMenu
                        .createExtendPopupMenu(configurationElement, editor);

                if (extendPopupMenu != null) {
                    extendPopupMenuList.add(extendPopupMenu);
                }
            }
        }
    }

    return extendPopupMenuList;
}
项目:dsl-devkit    文件:CheckCfgUtil.java   
/**
 * Retrieves all property contributions from the checkcfg property extension point.
 *
 * @return the collection of all available property contributions, never {@code null}
 */
public static Collection<ICheckCfgPropertySpecification> getAllPropertyContributions() {
  Set<ICheckCfgPropertySpecification> contributions = Sets.newHashSet();
  IExtensionRegistry registry = Platform.getExtensionRegistry();
  if (registry != null) { // registry is null in the standalone builder...
    IConfigurationElement[] elements = registry.getConfigurationElementsFor(PROPERTY_EXTENSION_POINT);
    for (IConfigurationElement element : elements) {
      try {
        contributions.add((ICheckCfgPropertySpecification) element.createExecutableExtension(PROPERTY_EXECUTABLE_EXTENSION_ATTRIBUTE));
      } catch (CoreException e) {
        LOGGER.log(Level.WARN, "Failed to instantiate property from " + element.getContributor(), e);
      }
    }
  }
  return contributions;
}
项目:typescript.java    文件:IDEResourcesManager.java   
private synchronized void loadExtensionResourceParticipants() {
    if (extensionResourceParticipantsLoaded)
        return;
    // Immediately set the flag, as to ensure that this method is never
    // called twice
    extensionResourceParticipantsLoaded = true;

    Trace.trace(Trace.EXTENSION_POINT, "->- Loading .typeScriptResourceParticipants extension point ->-");

    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(TypeScriptCorePlugin.PLUGIN_ID,
            EXTENSION_TYPESCRIPT_RESOURCE_PARTICIPANTS);

    addExtensionResourceParticipants(cf);
    addRegistryListenerIfNeeded();

    Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .typeScriptResourceParticipants extension point -<-");
}
项目:typescript.java    文件:IDETypeScriptRepositoryManager.java   
private synchronized void loadExtensionRepositories() {
    if (extensionRepositoriesLoaded)
        return;

    // Immediately set the flag, as to ensure that this method is never
    // called twice
    extensionRepositoriesLoaded = true;

    Trace.trace(Trace.EXTENSION_POINT, "->- Loading .typeScriptRepositories extension point ->-");

    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(TypeScriptCorePlugin.PLUGIN_ID,
            EXTENSION_TYPESCRIPT_REPOSITORIES);
    addExtensionRepositories(cf);
    resetDefaultRepository();
    addRegistryListenerIfNeeded();

    Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .typeScriptRepositories extension point -<-");
}
项目:typescript.java    文件:TypeScriptConsoleConnectorManager.java   
/**
 * Load the TypeScript console connectors.
 */
private synchronized void loadTypeScriptConsoleConnectors() {
    if (typeScriptConsoleConnectors != null)
        return;

    Trace.trace(Trace.EXTENSION_POINT, "->- Loading .typeScriptConsoleConnectors extension point ->-");

    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(TypeScriptCorePlugin.PLUGIN_ID,
            EXTENSION_TYPESCRIPT_CONSOLE_CONNECTORS);
    List<ITypeScriptConsoleConnector> list = new ArrayList<ITypeScriptConsoleConnector>(cf.length);
    addTypeScriptConsoleConnectors(cf, list);
    addRegistryListenerIfNeeded();
    typeScriptConsoleConnectors = list;

    Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .typeScriptConsoleConnectors extension point -<-");
}
项目:typescript.java    文件:NodejsInstallManager.java   
/**
 * Load the Nodejs installs.
 */
private synchronized void loadNodejsInstalls() {
    if (nodeJSInstalls != null)
        return;

    Trace.trace(Trace.EXTENSION_POINT, "->- Loading .nodeJSInstalls extension point ->-");

    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(TypeScriptCorePlugin.PLUGIN_ID,
            EXTENSION_NODEJS_INSTALLS);
    List<IEmbeddedNodejs> list = new ArrayList<IEmbeddedNodejs>(cf.length);
    addNodejsInstalls(cf, list);
    addRegistryListenerIfNeeded();
    nodeJSInstalls = list;

    Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .nodeJSInstalls extension point -<-");
}
项目:Source    文件:Activator.java   
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
 */
public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;

    fileTypeRegistry = new IdeFileTypeRegistry(MappingUtils.getFileTypeRegistry());
    MappingUtils.setFileTypeRegistry(fileTypeRegistry);

    IdeMappingUtils.getFileConectorDelegateRegistry().register(new TextFileConnectorDelegate());

    final IExtensionRegistry registry = Platform.getExtensionRegistry();
    registry.addListener(registryListener, IdeMappingRegistryListener.CONTAINER_PROVIDER_EXTENSION_POINT);
    registry.addListener(registryListener,
            IdeMappingRegistryListener.FILE_CONNECTOR_DELEGATE_EXTENSION_POINT);
    registry.addListener(registryListener, IdeMappingRegistryListener.CONNECTOR_EXTENSION_POINT);
    registry.addListener(registryListener, IdeMappingRegistryListener.MARKER_TO_LOCATION_EXTENSION_POINT);
    registry.addListener(registryListener, IdeMappingRegistryListener.LOCATION_EXTENSION_POINT);
    registry.addListener(registryListener, IdeMappingRegistryListener.BASE_PROVIDER_EXTENSION_POINT);
    registryListener.parseInitialContributions();
}
项目:NEXCORE-UML-Modeler    文件:NotationModelHandlerRegistry.java   
/**
 * 초기화
 * 
 * void
 */
private void init() {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement config[] = registry.getConfigurationElementsFor(MDDCoreConstant.NEXCORE_TOOL_MDD_CORE_NOTATION_MODEL_HANDLER);

    if (config != null) {
        notationModelHandlerContainerList = new ArrayList<INotationModelHandlerContainer>();

        for (IConfigurationElement element : config) {
            notationModelHandlerContainer = new NotationModelHandlerContainerImpl();

            try {
                notationModelHandlerContainer.setId(element.getAttribute(MDDCoreConstant.EXTENSION_ELEMENT_ID));
                notationModelHandlerContainer.setLabel(element.getAttribute(MDDCoreConstant.EXTENSION_ELEMENT_LABEL));
                notationModelHandlerContainer.setModelHandler((INotationModelHandler) element.createExecutableExtension(MDDCoreConstant.EXTENSION_ELEMENT_IMPLEMENT_INTERFACE));

                notationModelHandlerContainerList.add(notationModelHandlerContainer);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
项目:NEXCORE-UML-Modeler    文件:SemanticModelHandlerRegistry.java   
/**
 * 초기화
 * 
 * void
 */
private void init() {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement config[] = registry.getConfigurationElementsFor(MDDCoreConstant.NEXCORE_TOOL_MDD_CORE_SEMANTIC_MODEL_HANDLER);

    if (config != null) {
        semanticModelHandlerContainerList = new ArrayList<ISemanticModelHandlerContainer>();

        for (IConfigurationElement element : config) {
            semanticModelHandlerContainer = new SemanticModelHandlerContainerImpl();

            try {
                semanticModelHandlerContainer.setId(element.getAttribute(MDDCoreConstant.EXTENSION_ELEMENT_ID));
                semanticModelHandlerContainer.setLabel(element.getAttribute(MDDCoreConstant.EXTENSION_ELEMENT_LABEL));
                semanticModelHandlerContainer.setModelHandler((ISemanticModelHandler) element.createExecutableExtension(MDDCoreConstant.EXTENSION_ELEMENT_IMPLEMENT_INTERFACE));

                semanticModelHandlerContainerList.add(semanticModelHandlerContainer);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
项目:NEXCORE-UML-Modeler    文件:DomainModelHandlerRegistry.java   
/**
 * 초기화
 * 
 * void
 */
private void init() {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement config[] = registry.getConfigurationElementsFor(MDDCoreConstant.NEXCORE_TOOL_MDD_CORE_DOMAIN_MODEL_HANDLER);

    if (config != null) {
        domainModelHandlerContainerList = new ArrayList<IDomainModelHandlerContainer>();

        for (IConfigurationElement element : config) {
            domainModelHandlerContainer = new DomainModelHandlerContainerImpl();

            try {
                domainModelHandlerContainer.setId(element.getAttribute(MDDCoreConstant.EXTENSION_ELEMENT_ID));
                domainModelHandlerContainer.setLabel(element.getAttribute(MDDCoreConstant.EXTENSION_ELEMENT_LABEL));
                domainModelHandlerContainer.setModelHandler((IDomainModelHandler) element.createExecutableExtension(MDDCoreConstant.EXTENSION_ELEMENT_IMPLEMENT_INTERFACE));

                domainModelHandlerContainerList.add(domainModelHandlerContainer);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
项目:NEXCORE-UML-Modeler    文件:UMLDiagramApplicationRegistry.java   
/**
 * init
 *   void
 */
private void init() {
    list = new ArrayList<IUMLDiagramApplication>();
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement config[] = registry.getConfigurationElementsFor(NEXCORE_TOOL_UML_UI_CORE_EDITOR_EXTENSION);
    if (config != null) {
        for (IConfigurationElement element : config) {
            UMLDiagramApplication editor = new UMLDiagramApplication();
            try {
                editor.setFactory((EditPartFactory) element.createExecutableExtension(EXTENSION_EDIT_PART_FACTORY));
                editor.setName(element.getAttribute("name"));
                editor.setId(element.getAttribute("id"));
                list.add(editor);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
项目:NEXCORE-UML-Modeler    文件:NEXCOREProductRegistry.java   
/**
 * 제품을 담고 있는 래지스트를 다시 읽어서 초기화 한다.
 * 
 */
private static void refreshRegistry() {
    PRODUCT_LIST.clear();
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement config[] = registry.getConfigurationElementsFor("nexcore.tool.core.product");
    if (config != null) {
        for (IConfigurationElement element : config) {
            if (element != null) {
                NEXCOREProduct product = new NEXCOREProduct();
                // 프로덕트 아이디
                product.setProductId(element.getAttribute("productId"));
                // 프로덕트 이름
                product.setName(element.getAttribute("name"));
                // 프로덕트 버전
                product.setVersion(element.getAttribute("version"));

                PRODUCT_LIST.add(product);
            }
        }
    }
}
项目:NEXCORE-UML-Modeler    文件:UMLExplorerExtendedActionRegistry.java   
/**
 * 초기화
 * 
 * void
 */
private void init() {
    actionWrapperList = new ArrayList<IUMLExplorerExtendedActionWrapper>();

    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement config[] = registry.getConfigurationElementsFor(UICoreConstant.NEXCORE_TOOL_UML_EXPLORER_EXTENDED_ACTION);

    UMLExplorerExtendedActionWrapper actionWrapper = null;
    if (config != null) {
        for (IConfigurationElement element : config) {
            actionWrapper = new UMLExplorerExtendedActionWrapper();

            try {
                actionWrapper.setAction((AbstractUMLExplorerExtendedAction) element.createExecutableExtension(UICoreConstant.EXTENSION_ELEMENT_TARGET_CLASS));
                actionWrapper.setId(element.getAttribute(UICoreConstant.EXTENSION_ELEMENT_ID)); //$NON-NLS-1$
                actionWrapper.setLabel(element.getAttribute(UICoreConstant.EXTENSION_ELEMENT_LABEL)); //$NON-NLS-1$

                actionWrapperList.add(actionWrapper);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
项目:bts    文件:RemoteDBConnectionProviderContextFunction.java   
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
    IConfigurationElement[] config = ((((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))))
            .getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
    for (IConfigurationElement e : config)
    {
        final Object o = e.createExecutableExtension("class");
        if (o instanceof RemoteDAOFactory
                && (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
        {
            return (RemoteDAOFactory) o;
        }
    }
    throw new BTSDBException("No DaoFactory found for DBConnectionProvider and factory name: " + daoFactoryName);

}
项目:bts    文件:RemoteDBLeaseDaoContextFunction.java   
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
    IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
            .getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
    for (IConfigurationElement e : config)
    {
        final Object o = e.createExecutableExtension("class");
        if (o instanceof RemoteDAOFactory
                && (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
        {
            return (RemoteDAOFactory) o;
        }
    }
    throw new BTSDBException("No DaoFactory found for DBLeaseDao and factory name: " + daoFactoryName);

}
项目:bts    文件:RemoteBTSUserGroupDaoContextFunction.java   
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
    IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
            .getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
    for (IConfigurationElement e : config)
    {
        final Object o = e.createExecutableExtension("class");
        if (o instanceof RemoteDAOFactory
                && (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
        {
            return (RemoteDAOFactory) o;
        }
    }
    throw new BTSDBException("No DaoFactory found for BTSUserGroupDao and factory name: " + daoFactoryName);

}
项目:bts    文件:RemoteBTSUserDaoContextFunction.java   
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
    IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
            .getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
    for (IConfigurationElement e : config)
    {
        final Object o = e.createExecutableExtension("class");
        if (o instanceof RemoteDAOFactory
                && (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
        {
            return (RemoteDAOFactory) o;
        }
    }
    throw new BTSDBException("No DaoFactory found for BTSUserDao and factory name: " + daoFactoryName);

}
项目:bts    文件:RemoteDBManagerContextFunction.java   
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
    IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
            .getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
    for (IConfigurationElement e : config)
    {
        final Object o = e.createExecutableExtension("class");
        if (o instanceof RemoteDAOFactory
                && (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
        {
            return (RemoteDAOFactory) o;
        }
    }

    // in case no extension point found, look up context
    // this is necessary to run the same plugins on a Eclipse Virgo server for the web application
    RemoteDAOFactory factory = context.get(RemoteDAOFactory.class);
    if (factory != null) return factory;

    // if nothing found, throw exception
    throw new BTSDBException("No DaoFactory found for GeneralPurposeDao and factory name: " + daoFactoryName);

}
项目:bts    文件:RemoteBTSIDReservationObjectDaoContextFunction.java   
private RemoteDAOFactory loadDaoFactory(IEclipseContext context) throws CoreException
{
    IConfigurationElement[] config = ((IExtensionRegistry) context.get(IExtensionRegistry.class.getName()))
            .getConfigurationElementsFor(RemoteDaoConstants.REMOTE_DAO_FACTORY_EXTENSION_POINT_ID);
    for (IConfigurationElement e : config)
    {
        final Object o = e.createExecutableExtension("class");
        if (o instanceof RemoteDAOFactory
                && (daoFactoryName == null || daoFactoryName.equals(((RemoteDAOFactory) o).getFactoryName())))
        {
            return (RemoteDAOFactory) o;
        }
    }
    throw new BTSDBException("No DaoFactory found for BTSUserDao and factory name: " + daoFactoryName);

}