diff options
author | Benoit Maggi | 2016-04-27 13:07:06 +0000 |
---|---|---|
committer | Benoit Maggi | 2016-04-27 13:10:10 +0000 |
commit | 2f4a331c447760d075034b5f755ed46498d00b7a (patch) | |
tree | 101e69608686d9727b0754d3ffb00b0c8fed8ec8 /plugins/infra | |
parent | 98e0b5997caa8e85d0635d6ac8761117f00cfb38 (diff) | |
download | org.eclipse.papyrus-2f4a331c447760d075034b5f755ed46498d00b7a.tar.gz org.eclipse.papyrus-2f4a331c447760d075034b5f755ed46498d00b7a.tar.xz org.eclipse.papyrus-2f4a331c447760d075034b5f755ed46498d00b7a.zip |
Bug 492073 - [SysML 1.4][IBD] Comparment is hiden when created in Mars
and opened in Neon
- the reconcilier should only update compartment that aren't already a
BasicCompartment
Change-Id: Iebfb9ba6b3e303742a6899308bc1c7d12536706c
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
Diffstat (limited to 'plugins/infra')
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/reconciler/ReconcilerForCompartment.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/reconciler/ReconcilerForCompartment.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/reconciler/ReconcilerForCompartment.java index 4ec81494114..efa862f775c 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/reconciler/ReconcilerForCompartment.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/reconciler/ReconcilerForCompartment.java @@ -8,7 +8,7 @@ * * Contributors: * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and Implementation - * + * Benoit Maggi (CEA) - #492073: Reconcilier only for not already BasicCompartment *****************************************************************************/ package org.eclipse.papyrus.infra.gmfdiag.common.reconciler; @@ -97,22 +97,23 @@ abstract public class ReconcilerForCompartment extends DiagramReconciler { while (allContentIterator.hasNext()) { EObject eObject = allContentIterator.next(); - if (eObject instanceof DecorationNode && isCompartment((View) eObject)) { + if (eObject instanceof DecorationNode &&!(eObject instanceof BasicCompartment) && isCompartment((View) eObject)) { oldComparments.add((DecorationNode)eObject); } } for(DecorationNode oldCompartment : oldComparments) { - BasicCompartment newCompartment = NotationFactory.eINSTANCE.createBasicCompartment(); - newCompartment.setType(oldCompartment.getType()); - newCompartment.setVisible(oldCompartment.isVisible()); - newCompartment.setMutable(oldCompartment.isMutable()); - newCompartment.setLayoutConstraint(oldCompartment.getLayoutConstraint()); - newCompartment.getStyles().addAll(oldCompartment.getStyles()); - newCompartment.getPersistedChildren().addAll(oldCompartment.getPersistedChildren()); - if (oldCompartment.isSetElement()) - newCompartment.setElement(oldCompartment.getElement()); - EcoreUtil.replace(oldCompartment, newCompartment); + BasicCompartment newCompartment = NotationFactory.eINSTANCE.createBasicCompartment(); + newCompartment.setType(oldCompartment.getType()); + newCompartment.setVisible(oldCompartment.isVisible()); + newCompartment.setMutable(oldCompartment.isMutable()); + newCompartment.setLayoutConstraint(oldCompartment.getLayoutConstraint()); + newCompartment.getStyles().addAll(oldCompartment.getStyles()); + newCompartment.getPersistedChildren().addAll(oldCompartment.getPersistedChildren()); + if (oldCompartment.isSetElement()) { + newCompartment.setElement(oldCompartment.getElement()); + } + EcoreUtil.replace(oldCompartment, newCompartment); } return CommandResult.newOKCommandResult(); @@ -154,7 +155,7 @@ abstract public class ReconcilerForCompartment extends DiagramReconciler { */ @Override protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { - throw new ExecutionException("Should not be called, canRedo false"); + throw new ExecutionException("Should not be called, canRedo false"); //$NON-NLS-1$ } /** @@ -171,7 +172,7 @@ abstract public class ReconcilerForCompartment extends DiagramReconciler { */ @Override protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { - throw new ExecutionException("Should not be called, canUndo false"); + throw new ExecutionException("Should not be called, canUndo false"); //$NON-NLS-1$ } } |