Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2017-03-21 11:19:58 +0000
committerMaxime Porhel2017-03-21 14:04:05 +0000
commit06e5976837363087e6cbf9a9483ae79949a82852 (patch)
tree4db7b458d0d673ce2936d0b8f5b26d06b537c57b
parent8583155a93bc9f06503b990897dc0ec2aec57ef1 (diff)
downloadorg.eclipse.sirius-06e5976837363087e6cbf9a9483ae79949a82852.tar.gz
org.eclipse.sirius-06e5976837363087e6cbf9a9483ae79949a82852.tar.xz
org.eclipse.sirius-06e5976837363087e6cbf9a9483ae79949a82852.zip
[512444] EditModeDecorator should compute isBroken image firstv3.1.8
The previous commit on EditModeDecorator optimized the decorator refresh by removing duplicates in calls to permission authority and isBroken checks (see shoulBeDecorated() and getDecorationImage()). The logic of the previous version of shouldBeDecorated was moved to getDecorationImage but this changed the image priority: now the lock status is displayed even if the edit part is broken whereas we want to display only the red cross when the part is broken even if the lock status could lead to a specific decoration. This commit set back the previous getImage() computation priority. Bug: 512444 Cherry-picked-from: 512292 Change-Id: Ib146180cf051f17095787563e5ec121406a5825c Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/EditModeDecorator.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/EditModeDecorator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/EditModeDecorator.java
index 16e1943856..7c6f450f3c 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/EditModeDecorator.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/EditModeDecorator.java
@@ -100,9 +100,15 @@ public class EditModeDecorator extends AbstractSiriusDecorator {
if (editPart instanceof IDiagramElementEditPart) {
IDiagramElementEditPart part = (IDiagramElementEditPart) editPart;
- // Case 1 : permission authority forbids the edition of the semantic
+ // Case 1 : edit part is broken
+ if (isBroken(editPart)) {
+ // If the edit part is broken, we return a "deleted" image (red cross)
+ decorationImage = DiagramUIPlugin.getPlugin().getImage(DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.DELETE_FROM_DIAGRAM_ICON));
+ }
+
+ // Case 2 : permission authority forbids the edition of the semantic
// element associated to this edit part
- if (isDecorableEditPart(part)) {
+ if (decorationImage == null && isDecorableEditPart(part)) {
IPermissionAuthority auth = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(part.getEditingDomain().getResourceSet());
if (auth != null) {
EObject representedObject = part.resolveTargetSemanticElement();
@@ -112,11 +118,6 @@ public class EditModeDecorator extends AbstractSiriusDecorator {
}
}
- // Case 2 : edit part is broken
- if (decorationImage == null && isBroken(editPart)) {
- // If the edit part is broken, we return a "deleted" image (red cross)
- decorationImage = DiagramUIPlugin.getPlugin().getImage(DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.DELETE_FROM_DIAGRAM_ICON));
- }
}
return decorationImage;
}

Back to the top