Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2013-12-17 08:58:45 +0000
committerVincent Lorenzo2013-12-17 09:06:53 +0000
commit27be3cf898d7a22e0efaa84e769157e6b7943521 (patch)
tree03a1ee0b2406dfcaf4c24edfc75c1d5aca8ea847 /plugins
parentcbe597eb44fe6e68cf80dd5413244a02bd6d6070 (diff)
downloadorg.eclipse.papyrus-27be3cf898d7a22e0efaa84e769157e6b7943521.tar.gz
org.eclipse.papyrus-27be3cf898d7a22e0efaa84e769157e6b7943521.tar.xz
org.eclipse.papyrus-27be3cf898d7a22e0efaa84e769157e6b7943521.zip
Correct dispose errors on the table
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java13
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java11
2 files changed, 15 insertions, 9 deletions
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 4f6c12f5112..4b9e0d208bb 100644
--- 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
@@ -23,7 +23,6 @@ import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.nebula.widgets.nattable.NatTable;
import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration;
-import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry;
import org.eclipse.nebula.widgets.nattable.config.EditableRule;
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
@@ -422,9 +421,15 @@ public abstract class AbstractNattableWidgetManager implements INattableModelMan
@Override
public void dispose() {
- this.bodyDataProvider.dispose();
- this.rowHeaderDataProvider.dispose();
- this.columnHeaderDataProvider.dispose();
+ if(this.bodyDataProvider != null) {
+ this.bodyDataProvider.dispose();
+ }
+ if(this.rowHeaderDataProvider != null) {
+ this.rowHeaderDataProvider.dispose();
+ }
+ if(this.columnHeaderDataProvider != null) {
+ this.columnHeaderDataProvider.dispose();
+ }
this.tableContext = null;
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
index 7fd56632a9f..a41420854ca 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
@@ -94,9 +94,6 @@ import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import com.google.common.collect.BiMap;
-import com.google.common.collect.HashBiMap;
-
public class NattableModelManager extends AbstractNattableWidgetManager implements INattableModelManager, IAdaptable {
/**
@@ -502,8 +499,12 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen
@Override
public void dispose() {
if(this.tableEditingDomain != null && this.contextEditingDomain != null) {
- this.tableEditingDomain.getCommandStack().removeCommandStackListener(this.refreshListener);
- this.contextEditingDomain.getCommandStack().removeCommandStackListener(this.refreshListener);
+ if(this.tableEditingDomain.getCommandStack() != null) {
+ this.tableEditingDomain.getCommandStack().removeCommandStackListener(this.refreshListener);
+ }
+ if(this.contextEditingDomain.getCommandStack() != null) {
+ this.contextEditingDomain.getCommandStack().removeCommandStackListener(this.refreshListener);
+ }
this.columnManager.dispose();
this.rowManager.dispose();
Table table = getTable();

Back to the top