Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2020-02-10 14:13:24 +0000
committervincent lorenzo2020-02-18 09:09:33 +0000
commite74c3eb77313d30931e40aca94a5beb3dea42d9b (patch)
tree2a74b2e48e7862b7847e961968fa683847ec6a1d
parente172769d789e074fddda857fce8d53315e6968d5 (diff)
downloadorg.eclipse.papyrus-e74c3eb77313d30931e40aca94a5beb3dea42d9b.tar.gz
org.eclipse.papyrus-e74c3eb77313d30931e40aca94a5beb3dea42d9b.tar.xz
org.eclipse.papyrus-e74c3eb77313d30931e40aca94a5beb3dea42d9b.zip
Bug 559975: [Table][TreeTable] Axis with no represented element must be displayed at the end of the level
Change-Id: I7aba7dc2ae4606e865bc54d368364b2f7ee9791d 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/ITreeItemAxisComparator.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/ITreeItemAxisComparator.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/ITreeItemAxisComparator.java
index 4b2129213d0..0a712355c29 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/ITreeItemAxisComparator.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/ITreeItemAxisComparator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2015 CEA LIST and others.
- *
+ * Copyright (c) 2015, 2020 CEA LIST and others.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
- *
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 559975
*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.manager.axis;
@@ -32,8 +32,8 @@ import org.eclipse.papyrus.infra.nattable.utils.TableHelper;
/**
* This comparator is used to sort the ITreeItemAxis in the table according to the UML Model and the table model (order of the filling configuration).
- * The sort of the row selecting the header IS NOI DONE HERE!
- *
+ * The sort of the row selecting the header IS NOT DONE HERE!
+ * This comparator sort the empty line {@link ITreeItemAxis#getElement()}==null at the end of the table.
*
*/
public class ITreeItemAxisComparator implements Comparator<ITreeItemAxis> {
@@ -200,6 +200,15 @@ public class ITreeItemAxisComparator implements Comparator<ITreeItemAxis> {
if (values instanceof List<?>) {
index1 = ((List<?>) values).indexOf(axis1.getElement());
index2 = ((List<?>) values).indexOf(axis2.getElement());
+ if (index1 == -1 && index2 == -1) {
+ // no idea about this case
+ } else
+ // allows to set empty line at the end of the table
+ if (index1 == -1) {
+ index1 = index2 + 1;
+ } else if (index2 == -1) {
+ index2 = index1 + 1;
+ }
} else {
index1 = index2 = 0;
}

Back to the top