本文整理汇总了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;
}
示例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);
}
}
}
}
}
示例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;
}