diff options
author | cbateman | 2007-10-05 20:50:48 +0000 |
---|---|---|
committer | cbateman | 2007-10-05 20:50:48 +0000 |
commit | 30a9e184eace770ce704c1bc69e60a1dfd84444f (patch) | |
tree | fb99c2625fc07df224aea5a55457b4d847746543 /jsf/plugins/org.eclipse.jst.jsf.common.ui/src/org | |
parent | 871d5efb9d5aacb53706c38cf65f04c68c98e3c3 (diff) | |
download | webtools.jsf-30a9e184eace770ce704c1bc69e60a1dfd84444f.tar.gz webtools.jsf-30a9e184eace770ce704c1bc69e60a1dfd84444f.tar.xz webtools.jsf-30a9e184eace770ce704c1bc69e60a1dfd84444f.zip |
Fixed the last deprecation warning in the plugin and increased the severity of deprecated use to error.
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.common.ui/src/org')
-rw-r--r-- | jsf/plugins/org.eclipse.jst.jsf.common.ui/src/org/eclipse/jst/jsf/common/ui/internal/guiutils/IntroductionSection.java | 70 |
1 files changed, 45 insertions, 25 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common.ui/src/org/eclipse/jst/jsf/common/ui/internal/guiutils/IntroductionSection.java b/jsf/plugins/org.eclipse.jst.jsf.common.ui/src/org/eclipse/jst/jsf/common/ui/internal/guiutils/IntroductionSection.java index 51419a7ac..e8fd6f0bf 100644 --- a/jsf/plugins/org.eclipse.jst.jsf.common.ui/src/org/eclipse/jst/jsf/common/ui/internal/guiutils/IntroductionSection.java +++ b/jsf/plugins/org.eclipse.jst.jsf.common.ui/src/org/eclipse/jst/jsf/common/ui/internal/guiutils/IntroductionSection.java @@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Plugin; import org.eclipse.help.HelpSystem; import org.eclipse.help.IContext; import org.eclipse.help.IHelpResource; @@ -53,6 +52,9 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; * * this was original written by Collinsc * + * TODO: Should this be moved into the facesconfig ui plugin since it is only + * really used there? + * * @author collinsc,jchoi */ public class IntroductionSection extends SectionPart { @@ -209,39 +211,57 @@ public class IntroductionSection extends SectionPart { if (iconPath != null && iconPath.length() > 0) { // add an icon to the page + String iconName; + if (iconPath.indexOf(IPath.SEPARATOR) != -1) { + iconName = new Path(iconPath).lastSegment(); + } else { + iconName = iconPath; + } - if (iconPath != null) { - String iconName; - if (iconPath.indexOf(IPath.SEPARATOR) != -1) { - iconName = new Path(iconPath).lastSegment(); - } else { - iconName = iconPath; - } - - Plugin plugin = Platform.getPlugin(element - .getDeclaringExtension().getContributor().getName()); - if (plugin instanceof AbstractUIPlugin) { - ImageRegistry imageRegistry = ((AbstractUIPlugin) plugin) - .getImageRegistry(); - Image image = imageRegistry.get(iconName); - if (image == null) { - ImageDescriptor imageDescriptor = AbstractUIPlugin - .imageDescriptorFromPlugin( - element.getDeclaringExtension() - .getContributor().getName(), iconPath); - imageRegistry.put(iconName, imageDescriptor); - image = imageRegistry.get(iconName); + ImageDescriptor imageDescriptor = AbstractUIPlugin + .imageDescriptorFromPlugin( + element.getDeclaringExtension() + .getContributor().getName(), iconPath); + + if (imageDescriptor != null) + { + ImageRegistry imageRegistry = + JSFUICommonPlugin.getDefault().getImageRegistry(); + + + Image image = imageRegistry.get(iconName); + + if (image == null) + { + image = imageDescriptor.createImage(); + + if (image != null) + { + imageRegistry.put(iconName, image); } - + else + { + image = ImageDescriptor.getMissingImageDescriptor().createImage(); + } + } + + if (image != null) + { ImageContainer img = new ImageContainer(parent); img.setImage(image); TableWrapData td = new TableWrapData(); td.rowspan = 2; img.setLayoutData(td); } + else + { + JSFUICommonPlugin.getLogger(this.getClass()).error(new Throwable("Image not created for "+element)); + } + } + else + { + JSFUICommonPlugin.getLogger(this.getClass()).error(new Throwable("Image Descriptor not found for "+element)); } - - } if (heading != null && heading.length() > 0) { |