diff options
Diffstat (limited to 'plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/EmptyLineUMLElementTreeAxisManagerForEventList.java')
-rwxr-xr-x | plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/EmptyLineUMLElementTreeAxisManagerForEventList.java | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/EmptyLineUMLElementTreeAxisManagerForEventList.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/EmptyLineUMLElementTreeAxisManagerForEventList.java index 5e6d8270d6f..12132e5763d 100755 --- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/EmptyLineUMLElementTreeAxisManagerForEventList.java +++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/EmptyLineUMLElementTreeAxisManagerForEventList.java @@ -11,7 +11,7 @@ * * Contributors: * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - bug 563217 *****************************************************************************/ package org.eclipse.papyrus.uml.nattable.manager.axis; @@ -27,7 +27,7 @@ import org.eclipse.papyrus.infra.nattable.utils.FillingConfigurationUtils; /** * TODO : not yet tested with no {@link TreeFillingConfiguration} for depth==0 * Axis Manager with one empty line at each level - * + * * @since 5.4 */ public class EmptyLineUMLElementTreeAxisManagerForEventList extends UMLElementTreeAxisManagerForEventList { @@ -70,10 +70,24 @@ public class EmptyLineUMLElementTreeAxisManagerForEventList extends UMLElementTr * @param axis */ @Override - protected void fillChildrenForSemanticElement(ITreeItemAxis axis) { - if (this.createEmptyRow && axis != null - && axis.getElement() != null) {// to avoid to add empty axis to an empty axis - if (axis.getChildren().size() == 0) { + protected void fillChildrenForSemanticElement(final ITreeItemAxis axis) { + if (this.createEmptyRow) { + if (axis == null) { + int nextDepth = 0; + Object context = getTableContext(); + final List<TreeFillingConfiguration> confs = FillingConfigurationUtils.getTreeFillingConfigurationForDepth(getTable(), representedAxisManager, nextDepth); + for (TreeFillingConfiguration current : confs) { + final Collection<?> values = getFilteredValueAsCollection(current, context, nextDepth); + // with empty line, we always create a new axis for the TreeFillingConfiguration + ITreeItemAxis newAxis = addObject(axis, current); + if (nextDepth == 0) { + for (Object curr : values) { + addObject(newAxis, curr); + } + } + } + } + if (axis != null && axis.getElement() != null && axis.getChildren().size() == 0) { int nextDepth = getSemanticDepth(axis) + 1; Object context = axis.getElement(); Assert.isTrue(!(context instanceof TreeFillingConfiguration)); @@ -95,5 +109,6 @@ public class EmptyLineUMLElementTreeAxisManagerForEventList extends UMLElementTr } else { super.fillChildrenForSemanticElement(axis); } + } } |