diff options
author | Vincent Lorenzo | 2017-09-26 13:18:23 +0000 |
---|---|---|
committer | vincent lorenzo | 2017-09-27 11:26:54 +0000 |
commit | 6b7189562acdfe30601e6cb9ad2db28acf0614e0 (patch) | |
tree | 6bc2459a95294f41f5daf85931728a615ddbc1cb | |
parent | cdbe6b5cb4328a66b17b9ef74504e758f869f14f (diff) | |
download | org.eclipse.papyrus-6b7189562acdfe30601e6cb9ad2db28acf0614e0.tar.gz org.eclipse.papyrus-6b7189562acdfe30601e6cb9ad2db28acf0614e0.tar.xz org.eclipse.papyrus-6b7189562acdfe30601e6cb9ad2db28acf0614e0.zip |
bug 517742: [Table][Matrix] The row axis must be updated when the rows sources change
- fix broken JUnit tests
Change-Id: I61fe51c18f9e89656329903ec22895f2b1590aee
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r-- | plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractTreeAxisManagerForEventList.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractTreeAxisManagerForEventList.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractTreeAxisManagerForEventList.java index 35f48e0670e..c301e26296c 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractTreeAxisManagerForEventList.java +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractTreeAxisManagerForEventList.java @@ -576,6 +576,12 @@ public abstract class AbstractTreeAxisManagerForEventList extends AbstractAxisMa } final ITreeItemAxis parentAxis = axis.getParent(); final Command ac = new AbstractCommand() { + + /** + * the command used to remove the parent (a TreeFillingConfiguration) when there is no more child for it + */ + private Command removeParentCommand = null; + /** * @see org.eclipse.emf.common.command.Command#redo() * @@ -586,7 +592,10 @@ public abstract class AbstractTreeAxisManagerForEventList extends AbstractAxisMa } @Override - public void undo() { + public void undo() { + if (null != this.removeParentCommand) { + this.removeParentCommand.undo();//seem work without this line, strange... + } // we need to redo the same stuff, but with the invert order final TransactionalEditingDomain tableEditingDomain = getTableEditingDomain(); if (null != tableEditingDomain) { @@ -622,6 +631,16 @@ public abstract class AbstractTreeAxisManagerForEventList extends AbstractAxisMa if (null != tableEditingDomain) { ITreeItemAxisHelper.destroyITreeItemAxis(tableEditingDomain, axis); } + + if (parentAxis != null) { + final Object representedElement = parentAxis.getElement(); + if (representedElement instanceof TreeFillingConfiguration && parentAxis.getChildren().size() == 0) { + this.removeParentCommand = getRemoveAxisCommand(parentAxis); + if (null != this.removeParentCommand && this.removeParentCommand.canExecute()) { + this.removeParentCommand.execute(); + } + } + } } /** |