Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2014-01-29 08:11:40 -0500
committervlorenzo2014-01-29 08:11:40 -0500
commitfc442a158e6c6f088ebe04b3f713722e3b1f3269 (patch)
tree741f6eeaf43c0dca3039963a51e62a5462099e11
parent81c5dd55c3688d199a528be73d70b133793c22b4 (diff)
downloadorg.eclipse.papyrus-fc442a158e6c6f088ebe04b3f713722e3b1f3269.tar.gz
org.eclipse.papyrus-fc442a158e6c6f088ebe04b3f713722e3b1f3269.tar.xz
org.eclipse.papyrus-fc442a158e6c6f088ebe04b3f713722e3b1f3269.zip
426883: [Table 2][Xtext] Xtext editor in table aren't closed properly
and break the selection in the table https://bugs.eclipse.org/bugs/show_bug.cgi?id=426883
-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