diff options
author | Vincent Lorenzo | 2015-11-10 15:24:56 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2015-11-12 12:20:21 +0000 |
commit | 3655f025357e9f84fabb35328298eb6dd9296502 (patch) | |
tree | 3834eb5a342eca2a188767d396dc1cd48b2e65fa /plugins | |
parent | 9f730d61b2ecda12352364361cb687cf8269bae1 (diff) | |
download | org.eclipse.papyrus-3655f025357e9f84fabb35328298eb6dd9296502.tar.gz org.eclipse.papyrus-3655f025357e9f84fabb35328298eb6dd9296502.tar.xz org.eclipse.papyrus-3655f025357e9f84fabb35328298eb6dd9296502.zip |
bug 481017: [Table] Action Reload Table Editor breaks the table editor - fix and small refactoring
Diffstat (limited to 'plugins')
3 files changed, 9 insertions, 43 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EObjectTreeAxisManagerForEventList.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EObjectTreeAxisManagerForEventList.java index 56cda5f076f..cf375726ba9 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EObjectTreeAxisManagerForEventList.java +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EObjectTreeAxisManagerForEventList.java @@ -45,14 +45,6 @@ import org.eclipse.papyrus.infra.nattable.tree.ITreeItemAxisHelper; public class EObjectTreeAxisManagerForEventList extends AbstractTreeAxisManagerForEventList implements IAxisManagerForEventList, ITreeItemAxisManagerForEventList { - - /** - * NOT IN THE API, only here to do the dev about the display of the category (intermediate level displayed filling configuration - * - */ - public static final boolean DISPLAY_CATEOGORY = HierarchicalRowLabelHeaderDataProvider.DISPLAY_CATEOGORY; - - /** * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(org.eclipse.emf.transaction.TransactionalEditingDomain, java.util.Collection) * diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/HierarchicalRowLabelHeaderDataProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/HierarchicalRowLabelHeaderDataProvider.java index 24d357c6949..55254b44568 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/HierarchicalRowLabelHeaderDataProvider.java +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/HierarchicalRowLabelHeaderDataProvider.java @@ -13,13 +13,9 @@ package org.eclipse.papyrus.infra.nattable.dataprovider;
-import java.util.Collection;
-
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.manager.table.ITreeNattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.ITreeItemAxis;
-import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.IFillingConfiguration;
-import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.TreeFillingConfiguration;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattablestyle.DisplayStyle;
import org.eclipse.papyrus.infra.nattable.utils.FillingConfigurationUtils;
import org.eclipse.papyrus.infra.nattable.utils.TableHelper;
@@ -40,13 +36,6 @@ public class HierarchicalRowLabelHeaderDataProvider extends RowLabelHeaderDataPr }
/**
- * NOT IN THE API, only here to do the dev about the display of the category (intermediate level displayed filling configuration
- *
- */
- public static final boolean DISPLAY_CATEOGORY = true;
-
-
- /**
*
* @see org.eclipse.papyrus.infra.nattable.dataprovider.AbstractDataProvider#getColumnCount()
*
@@ -59,31 +48,15 @@ public class HierarchicalRowLabelHeaderDataProvider extends RowLabelHeaderDataPr if (DisplayStyle.NORMAL.equals(style) || DisplayStyle.HIERARCHIC_SINGLE_TREE_COLUMN.equals(style)) {
return 1;
} else if (DisplayStyle.HIERARCHIC_MULTI_TREE_COLUMN.equals(style)) {
- if (DISPLAY_CATEOGORY) {
- boolean hasConfForFirstLevel = FillingConfigurationUtils.hasTreeFillingConfigurationForDepth(this.manager.getTable(), 0);
- int maxDepth = FillingConfigurationUtils.getMaxDepthForTree(this.manager.getTable());
- int depth = maxDepth * 2;
- if (!hasConfForFirstLevel) {
- depth += 1;
- } else {
- depth += 2;
- }
-
- return depth;
+ boolean hasConfForFirstLevel = FillingConfigurationUtils.hasTreeFillingConfigurationForDepth(this.manager.getTable(), 0);
+ int maxDepth = FillingConfigurationUtils.getMaxDepthForTree(this.manager.getTable());
+ int depth = maxDepth * 2;
+ if (!hasConfForFirstLevel) {
+ depth += 1;
} else {
- // TODO : remove me?!
- int maxDepth = 1;
- final Collection<IFillingConfiguration> a = FillingConfigurationUtils.getFillingConfigurationUsedInTable(this.manager.getTable(), false);
- for (IFillingConfiguration iFillingConfiguration : a) {
- if (iFillingConfiguration instanceof TreeFillingConfiguration) {
- int tmp = ((TreeFillingConfiguration) iFillingConfiguration).getDepth();
- if (tmp > maxDepth) {
- maxDepth = tmp;
- }
- }
- }
- return maxDepth + 1;
+ depth += 2;
}
+ return depth;
}
}
return 0;
@@ -94,7 +67,7 @@ public class HierarchicalRowLabelHeaderDataProvider extends RowLabelHeaderDataPr * @param axis
* a tree item axis
* @return
- * the depth of the element
+ * the depth of the element
*/
protected final int getDepth(final ITreeItemAxis axis) {
if (this.manager instanceof ITreeNattableModelManager) {
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java index 58c2aa6be16..700623d1ac9 100755 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java @@ -1174,6 +1174,7 @@ public abstract class AbstractNattableWidgetManager implements INattableModelMan this.tableEditingDomain = null; this.contextEditingDomain = null; this.tableContext = null; + this.natTable.dispose(); } public EObject getTableContext() { |