diff options
author | Pascal Rapicault (JBoss) | 2013-04-04 19:20:34 +0000 |
---|---|---|
committer | Pascal Rapicault | 2013-04-09 12:03:06 +0000 |
commit | 56134fa584ab0cca4ab16dd948fffe484b9e4588 (patch) | |
tree | cdc49c607e80000af966bc2414aef38023f23b7f /bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProvElement.java | |
parent | b21015a993c391bf2f6d68204b24b89e06f02511 (diff) | |
download | rt.equinox.p2-56134fa584ab0cca4ab16dd948fffe484b9e4588.tar.gz rt.equinox.p2-56134fa584ab0cca4ab16dd948fffe484b9e4588.tar.xz rt.equinox.p2-56134fa584ab0cca4ab16dd948fffe484b9e4588.zip |
* overlay icon to show an addition, a removal, a downgrade or an upgrade * selectedRemedy were both in remediationPage and remediationOperation. Remove from the remediationPage.
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProvElement.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProvElement.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProvElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProvElement.java index 5f5b156a5..b9c58c663 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProvElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProvElement.java @@ -14,6 +14,8 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.ui.*; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.jface.viewers.DecorationOverlayIcon; +import org.eclipse.jface.viewers.IDecoration; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.ui.progress.IDeferredWorkbenchAdapter; @@ -56,6 +58,10 @@ public abstract class ProvElement implements IWorkbenchAdapter, IAdaptable { return null; } + protected String getImageOverlayId(Object obj) { + return null; + } + /* * (non-Javadoc) * @@ -89,7 +95,19 @@ public abstract class ProvElement implements IWorkbenchAdapter, IAdaptable { Image img = ProvUIImages.getImage(id); if (img == null) img = JFaceResources.getImageRegistry().get(id); - return img; + String overlayId = getImageOverlayId(object); + if (overlayId == null) + return img; + ImageDescriptor overlay = ProvUIActivator.getDefault().getImageRegistry().getDescriptor(overlayId); + String decoratedImageId = id.concat(overlayId); + if (ProvUIActivator.getDefault().getImageRegistry().get(decoratedImageId) == null) { + DecorationOverlayIcon decoratedImage = new DecorationOverlayIcon(img, overlay, IDecoration.BOTTOM_RIGHT); + ProvUIActivator.getDefault().getImageRegistry().put(decoratedImageId, decoratedImage); + } + Image decoratedImg = ProvUIActivator.getDefault().getImageRegistry().get(decoratedImageId); + if (decoratedImg == null) + return img; + return decoratedImg; } protected void handleException(Exception e, String message) { |