Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/celleditor/AbstractStyledTextCellEditor.java13
-rw-r--r--extraplugins/table/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java7
2 files changed, 13 insertions, 7 deletions
diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/celleditor/AbstractStyledTextCellEditor.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/celleditor/AbstractStyledTextCellEditor.java
index 0f875521e60..ede16907a8f 100644
--- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/celleditor/AbstractStyledTextCellEditor.java
+++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/celleditor/AbstractStyledTextCellEditor.java
@@ -29,8 +29,10 @@ import org.eclipse.nebula.widgets.nattable.style.IStyle;
import org.eclipse.nebula.widgets.nattable.widget.EditModeEnum;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.custom.VerifyKeyListener;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -240,6 +242,17 @@ public abstract class AbstractStyledTextCellEditor extends AbstractCellEditor {
//create the Text control based on the specified style
final StyledText textControl = createStyledText(parent, style);
+ //to avoid widget is disposed exception during the closing of the cell editor
+ textControl.addVerifyKeyListener(new VerifyKeyListener() {
+
+ @Override
+ public void verifyKey(VerifyEvent event) {
+ if(textControl.isDisposed()){
+ event.doit = false;
+ }
+ }
+ });
+
//set style information configured in the associated cell style
textControl.setBackground(this.cellStyle.getAttributeValue(CellStyleAttributes.BACKGROUND_COLOR));
textControl.setForeground(this.cellStyle.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR));
diff --git a/extraplugins/table/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java b/extraplugins/table/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
index 963d85c3fa7..09f319b9023 100644
--- a/extraplugins/table/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
+++ b/extraplugins/table/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
@@ -186,11 +186,4 @@ public abstract class AbstractNatTableXTextCellEditor extends AbstractPapyrusSty
return new XTextEditorResultWrapper(typedString, parseCommand);
}
- @Override
- public void close() {
- //TODO requred?
-// jfaceCellEditor.deactivate();
-// jfaceCellEditor.dispose();
- }
-
}

Back to the top