Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2015-08-04 10:10:09 +0000
committerMaxime Porhel2015-08-04 13:45:45 +0000
commit2641a2b6f10f597546086dd6cf18bd6b92b6fb37 (patch)
tree5ea678dff4d7fae2de21db95b2ce8b802e3963b7
parentce023bffb0d9069df99cb105e84e86d1b9dd40b6 (diff)
downloadorg.eclipse.sirius-2641a2b6f10f597546086dd6cf18bd6b92b6fb37.tar.gz
org.eclipse.sirius-2641a2b6f10f597546086dd6cf18bd6b92b6fb37.tar.xz
org.eclipse.sirius-2641a2b6f10f597546086dd6cf18bd6b92b6fb37.zip
[473944] Reinit the permission autorithy lock status listener.
Bug: 473944 Change-Id: Ib4828e2feaf4784e7cb6b0901b80b612ae3721bd Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/AbstractDTreeEditor.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/AbstractDTreeEditor.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/AbstractDTreeEditor.java
index 8ad59273c2..5aa4f99cc5 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/AbstractDTreeEditor.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/AbstractDTreeEditor.java
@@ -180,7 +180,7 @@ public abstract class AbstractDTreeEditor extends EditorPart implements DialectE
/** Singleton instance of the Image for the REPRESENTATION_FROZEN status. */
protected Image frozenRepresentationImage;
- /** CDO specific {@link IAuthorityListener}. */
+ /** The {@link IAuthorityListener}. */
private IAuthorityListener dRepresentationLockStatusListener;
/** Singleton instance of the Image for the LOCK_BY_ME status */
@@ -365,8 +365,8 @@ public abstract class AbstractDTreeEditor extends EditorPart implements DialectE
protected abstract void configureCommandFactoryProviders();
/**
- * Initialize {@link IPermissionAuthority} and the title image if the
- * Table is already locked by the current user before opening.
+ * Initialize {@link IPermissionAuthority} and the title image if the Table
+ * is already locked by the current user before opening.
*
* @param representation
* the {@link DSemanticDecorator} that is opening.
@@ -443,12 +443,22 @@ public abstract class AbstractDTreeEditor extends EditorPart implements DialectE
final URI uri = sessionEditorInput.getURI();
setRepresentation(uri, false);
IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session);
+
+ // Get the new representation
+ representation = getRepresentation();
if (uiSession != null && representation != null) {
// Reinit dialect editor closer and other
// IEditingSession mechanisms.
uiSession.detachEditor(this);
uiSession.attachEditor(this);
}
+
+ // Reinit the lock status listener.
+ IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(representation);
+ if (representation instanceof DSemanticDecorator && permissionAuthority != null && dRepresentationLockStatusListener != null) {
+ permissionAuthority.removeAuthorityListener(dRepresentationLockStatusListener);
+ initPermissionAuthority((DSemanticDecorator) representation);
+ }
}
}

Back to the top