Author: scabanovich
Date: 2012-01-30 18:11:09 -0500 (Mon, 30 Jan 2012)
New Revision: 38303
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/LabelDecoratorImpl.java
Log:
JBIDE-10448
https://issues.jboss.org/browse/JBIDE-10448
LabelDecoratorImpl should not fail for null image, it should only report the missing
image.
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/LabelDecoratorImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/LabelDecoratorImpl.java 2012-01-30
22:50:10 UTC (rev 38302)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/LabelDecoratorImpl.java 2012-01-30
23:11:09 UTC (rev 38303)
@@ -38,9 +38,17 @@
return new DecoratingLabelProviderExt(provider, decorator);
}
+ static Set<String> missingImages = new HashSet<String>();
+
public Image decorateImage(Image image, Object element) {
int severity = getErrorState(element);
- if(severity == IMarker.SEVERITY_ERROR) {
+ if(image == null && element instanceof XModelObject && severity > 0)
{
+ String entity = ((XModelObject)element).getModelEntity().getName();
+ if(!missingImages.contains(entity)) {
+ missingImages.add(entity);
+ ModelUIPlugin.getDefault().logWarning("Problem in " +
LabelDecoratorImpl.class.getName() + ": Cannot find icon for entity " + entity);
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else if(severity == IMarker.SEVERITY_ERROR) {
return getErrorImage(image);
} else if(severity == IMarker.SEVERITY_WARNING) {
return getWarningImage(image);