Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Fauth2022-11-05 13:17:48 +0000
committerDirk Fauth2022-11-05 13:27:28 +0000
commitd2665f464ce595e8afed0c5b8919d87564732b90 (patch)
tree8f27db55454cbe118a14e9d5d1a458816e580a4f
parent687b1ddb67f9e7067f43c8ede2088e5302a158a9 (diff)
downloadorg.eclipse.nebula.widgets.nattable-d2665f464ce595e8afed0c5b8919d87564732b90.tar.gz
org.eclipse.nebula.widgets.nattable-d2665f464ce595e8afed0c5b8919d87564732b90.tar.xz
org.eclipse.nebula.widgets.nattable-d2665f464ce595e8afed0c5b8919d87564732b90.zip
Bug 580992 - Some characters do not trigger KeyEditActions
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com> Change-Id: I64a2164f9c6f393a27027884e078d50ab04306ff
-rw-r--r--org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcherTest.java10
-rw-r--r--org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/edit/config/DefaultEditBindings.java5
-rw-r--r--org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcher.java6
3 files changed, 16 insertions, 5 deletions
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcherTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcherTest.java
index 30fe85ea..98493b8c 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcherTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcherTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2020 Original authors and others.
+ * Copyright (c) 2012, 2022 Original authors and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -96,5 +96,13 @@ public class LetterOrDigitKeyEventMatcherTest {
assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('='));
assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('\\'));
assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('"'));
+ assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('´'));
+ assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('`'));
+ assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('@'));
+ assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('^'));
+ assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('°'));
+ assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('|'));
+ assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('<'));
+ assertTrue(LetterOrDigitKeyEventMatcher.isLetterOrDigit('>'));
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/edit/config/DefaultEditBindings.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/edit/config/DefaultEditBindings.java
index e82a9d35..2789c38e 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/edit/config/DefaultEditBindings.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/edit/config/DefaultEditBindings.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2020 Original authors and others.
+ * Copyright (c) 2012, 2022 Original authors and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -65,6 +65,9 @@ public class DefaultEditBindings extends AbstractUiBindingConfiguration {
uiBindingRegistry.registerKeyBinding(
new LetterOrDigitKeyEventMatcher(SWT.MOD2),
new KeyEditAction());
+ uiBindingRegistry.registerKeyBinding(
+ new LetterOrDigitKeyEventMatcher(SWT.MOD1 | SWT.MOD3),
+ new KeyEditAction());
uiBindingRegistry.registerSingleClickBinding(
new CellEditorMouseEventMatcher(GridRegion.BODY),
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcher.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcher.java
index 1807c1cc..8e326cdc 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcher.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/matcher/LetterOrDigitKeyEventMatcher.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2020 Original authors and others.
+ * Copyright (c) 2012, 2022 Original authors and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -25,7 +25,7 @@ import org.eclipse.swt.events.KeyEvent;
* be populated to an editor like e.g. the question mark. The following regular
* expression will be used by this matcher:
*
- * <b>[\\.:,;\\-_#\'+*~!?§$%&amp;/()\\[\\]\\{\\}=\\\\\"]</b>
+ * <b>[\\.:,;\\-_#\'+*~!?§$%&amp;/()\\[\\]\\{\\}=\\\\\"&lt;&gt;@^°´`|]</b>
*/
public class LetterOrDigitKeyEventMatcher implements IKeyEventMatcher {
@@ -89,7 +89,7 @@ public class LetterOrDigitKeyEventMatcher implements IKeyEventMatcher {
return Character.isLetterOrDigit(character)
|| Character
.toString(character)
- .matches("[\\.:,;\\-_#\'+*~!?§$%&/()\\[\\]\\{\\}=\\\\\"]"); //$NON-NLS-1$
+ .matches("[\\.:,;\\-_#\'+*~!?§$%&/()\\[\\]\\{\\}=\\\\\"<>@^°´`|]"); //$NON-NLS-1$
}
}

Back to the top