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


Java Platform.getExtensionRegistry方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.Platform.getExtensionRegistry方法的典型用法代码示例。如果您正苦于以下问题:Java Platform.getExtensionRegistry方法的具体用法?Java Platform.getExtensionRegistry怎么用?Java Platform.getExtensionRegistry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.Platform的用法示例。


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

示例1: retrieveLocators

import org.eclipse.core.runtime.Platform; //导入方法依赖的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

示例2: readExtensions

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
private static void readExtensions(Map<Class<? extends IScanPathModel>, Class<? extends IPointGenerator<?>>> gens,
		                           Map<String,   GeneratorInfo> tids) throws CoreException {

	if (Platform.getExtensionRegistry()!=null) {
		final IConfigurationElement[] eles = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.scanning.api.generator");
		for (IConfigurationElement e : eles) {
			final IPointGenerator<?>    generator = (IPointGenerator<?>)e.createExecutableExtension("class");
			final IScanPathModel     model = (IScanPathModel)e.createExecutableExtension("model");

			final Class<? extends IScanPathModel> modelClass = model.getClass();
			@SuppressWarnings("unchecked")
			final Class<? extends IPointGenerator<?>> generatorClass = (Class<? extends IPointGenerator<?>>) generator.getClass();
			gens.put(modelClass, generatorClass);

			final GeneratorInfo info = new GeneratorInfo();
			info.setModelClass(model.getClass());
			info.setGeneratorClass(generator.getClass());
			info.setLabel(e.getAttribute("label"));
			info.setDescription(e.getAttribute("description"));

			String id = e.getAttribute("id");
			tids.put(id, info);
		}
	}
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:26,代码来源:PointGeneratorService.java

示例3: loadCodeLensProviders

import org.eclipse.core.runtime.Platform; //导入方法依赖的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

示例4: loadFactories

import org.eclipse.core.runtime.Platform; //导入方法依赖的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

示例5: getAvailableCodegenWizards

import org.eclipse.core.runtime.Platform; //导入方法依赖的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

示例6: getExtensions

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
 * Returns the extensions for a given extension point.
 *
 * @param pointID
 *            The extension point ID
 *
 * @return The extensions
 */
private static IExtension[] getExtensions(final String pointID) {
	IExtensionRegistry registry = Platform.getExtensionRegistry();
	IExtensionPoint point = registry.getExtensionPoint(pointID);
	if (point == null) {
		throw new IllegalStateException("Invalid extension point : " + pointID);

	}
	return point.getExtensions();
}
 
开发者ID:qqilihq,项目名称:knime-json-node-doc-generator,代码行数:18,代码来源:RepositoryManager.java

示例7: initialize

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
public void initialize() {
	IExtensionRegistry registry = Platform.getExtensionRegistry();
	registry.addRegistryChangeListener(this, CodeLensPlugin.PLUGIN_ID);
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:5,代码来源:CodeLensProviderRegistry.java

示例8: initialize

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
public void initialize() {
	IExtensionRegistry registry = Platform.getExtensionRegistry();
	registry.addRegistryChangeListener(this, CodeLensEditorPlugin.PLUGIN_ID);
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:5,代码来源:CodeLensControllerRegistry.java

示例9: getExtensionRegistry

import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
 * Gets the extension registry.
 * @return the extension registry
 */
private IExtensionRegistry getExtensionRegistry() {
	return Platform.getExtensionRegistry();
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:8,代码来源:EvaluateContributionsHandler.java


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