diff options
author | Maxime Porhel | 2017-03-21 11:19:58 +0000 |
---|---|---|
committer | Maxime Porhel | 2017-03-21 14:05:19 +0000 |
commit | 18755a2e134cd5617a658862f093cf3efc1832c8 (patch) | |
tree | 13a3b5a6bb61d23adb925703540df1ca2f7ff8f4 | |
parent | 872c7c2d944fdd0852d8cb40d14614c2a534c8e2 (diff) | |
download | org.eclipse.sirius-4.1.4.tar.gz org.eclipse.sirius-4.1.4.tar.xz org.eclipse.sirius-4.1.4.zip |
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: 512443
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.java | 15 |
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; } |