本文整理匯總了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;
}