当前位置: 首页>>代码示例>>Java>>正文


Java IExtensionRegistry类代码示例

本文整理汇总了Java中org.eclipse.core.runtime.IExtensionRegistry的典型用法代码示例。如果您正苦于以下问题:Java IExtensionRegistry类的具体用法?Java IExtensionRegistry怎么用?Java IExtensionRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IExtensionRegistry类属于org.eclipse.core.runtime包,在下文中一共展示了IExtensionRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:25,代码来源:TesterRegistry.java

示例2: initialize

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:25,代码来源:RunnerRegistry.java

示例3: retrieveLocators

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:29,代码来源:Activator.java

示例4: loadCodeLensProviders

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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;
	}
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:21,代码来源:CodeLensProviderRegistry.java

示例5: loadFactories

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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;
	}
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:21,代码来源:CodeLensControllerRegistry.java

示例6: getAvailableCodegenWizards

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
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;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:24,代码来源:AbstractNewProjectWizardWithTemplates.java

示例7: VariablesProviderRegistry

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
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);
	
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:23,代码来源:VariablesProviderRegistry.java

示例8: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HyexpressionEclipseProxy.java

示例9: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HymanifestEclipseProxy.java

示例10: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HymappingEclipseProxy.java

示例11: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HyconstraintsEclipseProxy.java

示例12: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HyvalidityformulaEclipseProxy.java

示例13: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HydatavalueEclipseProxy.java

示例14: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:DwprofileEclipseProxy.java

示例15: getConfigurationElementsForCheckinPolicy

import org.eclipse.core.runtime.IExtensionRegistry; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:27,代码来源:ExtensionPointPolicyLoader.java


注:本文中的org.eclipse.core.runtime.IExtensionRegistry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。