Search in sources :

Example 31 with IExtensionPoint

use of org.eclipse.core.runtime.IExtensionPoint in project liferay-ide by liferay.

the class RegistryReader method readRegistry.

public void readRegistry() {
    IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(pluginId, extensionPointId);
    if (point != null) {
        IConfigurationElement[] elements = point.getConfigurationElements();
        for (int i = 0; i < elements.length; i++) {
            _internalReadElement(elements[i]);
        }
    }
    if (_JEM_PLUGIN_ID.equals(pluginId)) {
        return;
    }
    point = Platform.getExtensionRegistry().getExtensionPoint(_JEM_PLUGIN_ID, extensionPointId);
    if (point == null) {
        return;
    }
    IConfigurationElement[] elements = point.getConfigurationElements();
    for (int i = 0; i < elements.length; i++) {
        _internalReadElement(elements[i]);
    }
}
Also used : IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint)

Example 32 with IExtensionPoint

use of org.eclipse.core.runtime.IExtensionPoint in project liferay-ide by liferay.

the class NewPluginProjectDropDownAction method getNewProjectActions.

public static NewWizardAction[] getNewProjectActions() {
    ArrayList<NewWizardAction> containers = new ArrayList<>();
    IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(PlatformUI.PLUGIN_ID, PL_NEW);
    if (extensionPoint != null) {
        IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
        for (IConfigurationElement element : elements) {
            if (element.getName().equals(TAG_WIZARD) && _isProjectWizard(element, getTypeAttribute())) {
                containers.add(new NewWizardAction(element));
            }
        }
    }
    NewWizardAction[] actions = (NewWizardAction[]) containers.toArray(new NewWizardAction[containers.size()]);
    Arrays.sort(actions);
    return actions;
}
Also used : IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) ArrayList(java.util.ArrayList) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement)

Example 33 with IExtensionPoint

use of org.eclipse.core.runtime.IExtensionPoint in project liferay-ide by liferay.

the class NewPluginProjectDropDownAction method getActionFromDescriptors.

public NewWizardAction[] getActionFromDescriptors(String typeAttribute) {
    ArrayList<NewWizardAction> containers = new ArrayList<>();
    IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(PlatformUI.PLUGIN_ID, PL_NEW);
    if (extensionPoint != null) {
        IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
        for (IConfigurationElement element : elements) {
            if (element.getName().equals(TAG_WIZARD) && _isLiferayArtifactWizard(element, typeAttribute)) {
                containers.add(new NewWizardAction(element));
            }
        }
    }
    NewWizardAction[] actions = (NewWizardAction[]) containers.toArray(new NewWizardAction[containers.size()]);
    Arrays.sort(actions);
    return actions;
}
Also used : IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) ArrayList(java.util.ArrayList) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement)

Example 34 with IExtensionPoint

use of org.eclipse.core.runtime.IExtensionPoint in project jbosstools-hibernate by jbosstools.

the class ServiceLookup method initialize.

private static void initialize() {
    SERVICES_MAP = new HashMap<String, IService>();
    IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
    IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint(SERVICES_EXTENSION_ID);
    for (IExtension extension : extensionPoint.getExtensions()) {
        for (IConfigurationElement configurationElement : extension.getConfigurationElements()) {
            try {
                Object object = configurationElement.createExecutableExtension("class");
                String name = configurationElement.getAttribute("name");
                if (object != null && name != null && object instanceof IService) {
                    SERVICES_MAP.put(name, (IService) object);
                }
            } catch (CoreException e) {
                HibernateServicePlugin.getDefault().log(e);
            }
        }
    }
    ArrayList<String> list = new ArrayList<String>(SERVICES_MAP.keySet());
    Collections.sort(list);
    VERSIONS = list.toArray(new String[list.size()]);
    DEFAULT_SERVICE = SERVICES_MAP.get(VERSIONS[VERSIONS.length - 1]);
}
Also used : IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) CoreException(org.eclipse.core.runtime.CoreException) IExtension(org.eclipse.core.runtime.IExtension) ArrayList(java.util.ArrayList) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) IExtensionRegistry(org.eclipse.core.runtime.IExtensionRegistry)

Example 35 with IExtensionPoint

use of org.eclipse.core.runtime.IExtensionPoint in project jbosstools-hibernate by jbosstools.

the class RuntimeServiceManager method initializeServicesMap.

private void initializeServicesMap() {
    servicesMap = new HashMap<String, IService>();
    initiallyEnabledVersions = new HashSet<String>();
    IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
    IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint(SERVICES_EXTENSION_ID);
    for (IExtension extension : extensionPoint.getExtensions()) {
        for (IConfigurationElement configurationElement : extension.getConfigurationElements()) {
            try {
                Object object = configurationElement.createExecutableExtension("class");
                String name = configurationElement.getAttribute("name");
                if (object != null && name != null && object instanceof IService) {
                    servicesMap.put(name, (IService) object);
                    if (!"true".equals(configurationElement.getAttribute("disabled"))) {
                        initiallyEnabledVersions.add(name);
                    }
                }
            } catch (CoreException e) {
                HibernateServicePlugin.getDefault().log(e);
            }
        }
    }
}
Also used : IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) CoreException(org.eclipse.core.runtime.CoreException) IExtension(org.eclipse.core.runtime.IExtension) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) IExtensionRegistry(org.eclipse.core.runtime.IExtensionRegistry)

Aggregations

IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)187 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)160 IExtensionRegistry (org.eclipse.core.runtime.IExtensionRegistry)107 IExtension (org.eclipse.core.runtime.IExtension)92 CoreException (org.eclipse.core.runtime.CoreException)70 ArrayList (java.util.ArrayList)29 HashMap (java.util.HashMap)17 Platform (org.eclipse.core.runtime.Platform)17 Stream (java.util.stream.Stream)16 List (java.util.List)15 NodeLogger (org.knime.core.node.NodeLogger)15 Map (java.util.Map)14 Optional (java.util.Optional)14 Collection (java.util.Collection)9 Bundle (org.osgi.framework.Bundle)9 Collectors (java.util.stream.Collectors)8 IOException (java.io.IOException)6 Collections (java.util.Collections)6 LinkedList (java.util.LinkedList)6 Objects (java.util.Objects)6