Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2015-05-28 14:06:00 +0000
committerMaxime Porhel2015-05-28 15:49:50 +0000
commit3ebbbd60de958b88c8c50d2335775165be034c9b (patch)
treeedb1ca8def47c8b123e31c7a4c53d3be8af64312
parent2ce62244436a7e8b78ec08cfb3492f28e88d5fcb (diff)
downloadorg.eclipse.sirius-3ebbbd60de958b88c8c50d2335775165be034c9b.tar.gz
org.eclipse.sirius-3ebbbd60de958b88c8c50d2335775165be034c9b.tar.xz
org.eclipse.sirius-3ebbbd60de958b88c8c50d2335775165be034c9b.zip
[460603] Reenable Viewpoint specified icon in Viewpoint selection
dialogs The icon specified in the VSM for Viewpoint is used in the VSM editor, in the ModelExplorer, in the Viewpoint selection wizard page but was not displayed in the Viewpoint selection dialog. Bug: 460603 Change-Id: Ia7966e2d01da43131fc750f9603876a8d3f46fcf Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/viewpoint/ViewpointSelectionDialog.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/viewpoint/ViewpointSelectionDialog.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/viewpoint/ViewpointSelectionDialog.java
index 5448aaf422..d9ae4f4e0f 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/viewpoint/ViewpointSelectionDialog.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/viewpoint/ViewpointSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2014, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -195,16 +195,25 @@ public class ViewpointSelectionDialog extends TitleAreaDialog {
@Override
public Image getImage(final Object element) {
Item item = (Item) element;
-
+
+ Image viewpointImage = null;
+ Viewpoint vp = item.getViewpoint();
+ if (vp.getIcon() != null && vp.getIcon().length() > 0) {
+ final ImageDescriptor desc = SiriusEditPlugin.Implementation.findImageDescriptor(vp.getIcon());
+ if (desc != null) {
+ viewpointImage = SiriusEditPlugin.getPlugin().getImage(desc);
+ }
+ }
// Default image
- Image viewpointImage = SiriusEditPlugin.getPlugin().getBundledImage("icons/full/obj16/Viewpoint.gif");
-
+ if (viewpointImage == null) {
+ viewpointImage = SiriusEditPlugin.getPlugin().getImage(SiriusEditPlugin.getPlugin().getItemImageDescriptor(vp));
+ }
+
// Add decorator if the viewpoint comes from workspace
- if (!ViewpointRegistry.getInstance().isFromPlugin(item.getViewpoint())) {
+ if (!ViewpointRegistry.getInstance().isFromPlugin(vp)) {
final ImageDescriptor decoratorDescriptor = SiriusEditPlugin.Implementation.getBundledImageDescriptor("icons/full/decorator/folder_close.gif");
viewpointImage = SiriusEditPlugin.getPlugin().getImage(new DecorationOverlayIcon(viewpointImage, decoratorDescriptor, IDecoration.BOTTOM_LEFT));
}
-
return viewpointImage;
}

Back to the top