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


Java IConfigurationElement.getName方法代码示例

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


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

示例1: getFileExtensions

import org.eclipse.core.runtime.IConfigurationElement; //导入方法依赖的package包/类
/**
 * 
 * @return the list of file extensions defined in the XDSML_Definition_customization
 */
public List<String> getFileExtensions() {
	ArrayList<String> fileExtensions = new ArrayList<String>();
	for (IConfigurationElement childConfElement : _configurationElement
			.getChildren(LanguageDefinitionExtensionPoint.GEMOC_LANGUAGE_EXTENSION_POINT_XDSML_CUSTOMIZATION_DEF)) {
		childConfElement.getName();
		final String fileExtensionsString = childConfElement
				.getAttribute(LanguageDefinitionExtensionPoint.GEMOC_LANGUAGE_EXTENSION_POINT_XDSML_CUSTOMIZATION_DEF_FILEEXTENSIONS_ATT);
		if (fileExtensionsString != null) {
			for( String fileExtension : fileExtensionsString.split(",")){
				fileExtensions.add(fileExtension.trim());
			}
		}
	}
	return fileExtensions;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:20,代码来源:LanguageDefinitionExtension.java

示例2: initialize

import org.eclipse.core.runtime.IConfigurationElement; //导入方法依赖的package包/类
/**
 * Read 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 IExtension[] extensions = registry.getExtensionPoint(FILE_EXTENSIONS_POINT_ID).getExtensions();
		for (IExtension extension : extensions) {
			final IConfigurationElement[] configElems = extension.getConfigurationElements();
			for (IConfigurationElement elem : configElems) {
				try {
					List<String> fileExtensions = Splitter.on(',').trimResults().omitEmptyStrings()
							.splitToList(elem.getAttribute(ATT_FILE_EXTENSION));

					String elementName = elem.getName();
					if (ATT_TRANSPILABLE_FILE_EXTENSIONS.equals(elementName)) {
						transpilableFileExtensions.addAll(fileExtensions);
					} else if (ATT_TEST_FILE_EXTENSIONS.equals(elementName)) {
						testFileExtensions.addAll(fileExtensions);
					} else if (ATT_RUNNABLE_FILE_EXTENSIONS.equals(elementName)) {
						runnableFileExtensions.addAll(fileExtensions);
					} else if (ATT_TYPABLE_FILE_EXTENSIONS.equals(elementName)) {
						typableFileExtensions.addAll(fileExtensions);
					} else if (ATT_RAW_FILE_EXTENSIONS.equals(elementName)) {
						rawFileExtensions.addAll(fileExtensions);
					} else {
						LOGGER.error(new UnsupportedOperationException(
								"This file extension type " + elementName + " is not supported yet"));
					}
				} catch (Exception ex) {
					LOGGER.error("Error while reading extensions for extension point " + FILE_EXTENSIONS_POINT_ID,
							ex);
				}
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:43,代码来源:FileExtensionsRegistry.java

示例3: instanciateEngineAddons

import org.eclipse.core.runtime.IConfigurationElement; //导入方法依赖的package包/类
final public Collection<IEngineAddon> instanciateEngineAddons() throws CoreException {
	ArrayList<IEngineAddon> addons = new ArrayList<IEngineAddon>();
	for (IConfigurationElement childConfElement : _configurationElement
			.getChildren(LanguageDefinitionExtensionPoint.GEMOC_LANGUAGE_EXTENSION_POINT_ENGINE_ADDON_DEF)) {
		childConfElement.getName();
		final Object addon = childConfElement
				.createExecutableExtension(LanguageDefinitionExtensionPoint.GEMOC_LANGUAGE_EXTENSION_POINT_ENGINE_ADDON_DEF_ENGINE_ADDON_ATT);
		if (addon instanceof IEngineAddon) {
			addons.add((IEngineAddon) addon);
		}
	}
	return addons;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:14,代码来源:LanguageDefinitionExtension.java


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