summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kriese2011-09-07 02:43:28 (EDT)
committerSteffen Kriese2011-09-07 02:43:28 (EDT)
commit2d4436a490be0ceac919eec2a7c7211d0c69c66c (patch)
treefe5f8f63443a52e6e7a9b0b33bb743b0deb91f0c
parent949748f26e19fc8a10e02fc176dd10e855883dce (diff)
downloadorg.eclipse.riena-2d4436a490be0ceac919eec2a7c7211d0c69c66c.zip
org.eclipse.riena-2d4436a490be0ceac919eec2a7c7211d0c69c66c.tar.gz
org.eclipse.riena-2d4436a490be0ceac919eec2a7c7211d0c69c66c.tar.bz2
added focusFinderHandler to riena.example.client to debug focus issuesv20110906_4_0_0_stable
-rw-r--r--org.eclipse.riena.example.client/plugin.xml20
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/handler/FocusFinderHandler.java27
2 files changed, 47 insertions, 0 deletions
diff --git a/org.eclipse.riena.example.client/plugin.xml b/org.eclipse.riena.example.client/plugin.xml
index c4f6573..5fa9d06 100644
--- a/org.eclipse.riena.example.client/plugin.xml
+++ b/org.eclipse.riena.example.client/plugin.xml
@@ -432,6 +432,13 @@
</extension>
<extension
point="org.eclipse.ui.commands">
+
+ <command
+ defaultHandler="org.eclipse.riena.example.client.handler.FocusFinderHandler"
+ id="de.compeople.scp.example.client.findfocus.command"
+ name="FindFocus">
+ </command>
+
<command
id="org.eclipse.riena.example.client.exitCommand"
name="Exit">
@@ -768,6 +775,10 @@
lnfkey="ModuleGroup.renderer">
</renderer>
</extension>
+
+
+
+
<extension
point="org.eclipse.ui.bindings">
<!-- example showing how to define own key bindings. See also: SwtExampleApplication#getKeyScheme() -->
@@ -776,6 +787,15 @@
name="Riena Client Key Bindings"
parentId="org.eclipse.riena.ui.defaultBindings">
</scheme>
+
+
+ <key
+ commandId="de.compeople.scp.example.client.findfocus.command"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.riena.example.client.scheme"
+ sequence="F10">
+ </key>
+
<key
commandId="org.eclipse.riena.example.client.exitCommand"
contextId="org.eclipse.ui.contexts.window"
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/handler/FocusFinderHandler.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/handler/FocusFinderHandler.java
new file mode 100644
index 0000000..688f7b3
--- /dev/null
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/handler/FocusFinderHandler.java
@@ -0,0 +1,27 @@
+package org.eclipse.riena.example.client.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+public class FocusFinderHandler extends AbstractHandler {
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final Control focusControl = Display.getCurrent().getFocusControl();
+ if (focusControl == null) {
+ System.err.println("no control has the focus?!?");
+ } else {
+ printFocus(focusControl, "Focus ");
+ }
+ return null;
+ }
+
+ private void printFocus(final Control control, final String indent) {
+ System.err.print(indent);
+ System.err.println("at " + control + " bindingID=" + control.getData("binding_property"));
+ if (control.getParent() != null) {
+ printFocus(control.getParent(), " ");
+ }
+ }
+}