本文整理匯總了Java中org.eclipse.core.runtime.IConfigurationElement.getNamespaceIdentifier方法的典型用法代碼示例。如果您正苦於以下問題:Java IConfigurationElement.getNamespaceIdentifier方法的具體用法?Java IConfigurationElement.getNamespaceIdentifier怎麽用?Java IConfigurationElement.getNamespaceIdentifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.runtime.IConfigurationElement
的用法示例。
在下文中一共展示了IConfigurationElement.getNamespaceIdentifier方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createWizardElement
import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
protected WizardElement createWizardElement(IConfigurationElement config) {
String name = config.getAttribute(WizardElement.ATT_NAME);
String id = config.getAttribute(WizardElement.ATT_ID);
String className = config.getAttribute(WizardElement.ATT_CLASS);
if (name == null || id == null || className == null)
return null;
WizardElement element = new WizardElement(config);
element.id = id;
String imageName = config.getAttribute(WizardElement.ATT_ICON);
if (imageName != null) {
String pluginID = config.getNamespaceIdentifier();
Image image = PDEPlugin.getDefault().getLabelProvider().getImageFromPlugin(pluginID, imageName);
element.setImage(image);
}
return element;
}
示例2: readMetanodes
import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
private void readMetanodes() {
// iterate over the meta node config elements and create meta node templates
IExtension[] metanodeExtensions = getExtensions(ID_META_NODE);
for (IExtension mnExt : metanodeExtensions) {
IConfigurationElement[] mnConfigElems = mnExt.getConfigurationElements();
for (IConfigurationElement mnConfig : mnConfigElems) {
try {
MetaNodeTemplate metaNode = RepositoryFactory.createMetaNode(mnConfig);
LOGGER.debug("Found meta node definition '" + metaNode.getID() + "': " + metaNode.getName());
IContainerObject parentContainer = m_root.findContainer(metaNode.getCategoryPath());
// If parent category is illegal, log an error and append the node to the
// repository root.
if (parentContainer == null) {
LOGGER.warn("Invalid category-path for node contribution: '" + metaNode.getCategoryPath()
+ "' - adding to root instead");
m_root.addChild(metaNode);
} else {
// everything is fine, add the node to its parent category
parentContainer.addChild(metaNode);
}
} catch (Throwable t) {
String message = "MetaNode " + mnConfig.getAttribute("id") + "' from plugin '"
+ mnConfig.getNamespaceIdentifier() + "' could not be created: " + t.getMessage();
Bundle bundle = Platform.getBundle(mnConfig.getNamespaceIdentifier());
if (bundle == null || bundle.getState() != Bundle.ACTIVE) {
// if the plugin is null, the plugin could not be activated maybe due to a not
// activateable plugin (plugin class cannot be found)
message = message + " The corresponding plugin bundle could not be activated!";
}
LOGGER.error(message, t);
}
}
}
}