summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcongwang2013-03-21 12:55:04 (EDT)
committerChris Recoskie2013-03-22 12:26:18 (EDT)
commit5a2009648983ad93fd6a4a395fbfdd767e648cc9 (patch)
tree60a54ae77345bcd09872c51009a1e3d2d3b2617a
parentb9c692e6d8f0ed487362079173fec533a722b138 (diff)
downloadorg.eclipse.cdt-5a2009648983ad93fd6a4a395fbfdd767e648cc9.zip
org.eclipse.cdt-5a2009648983ad93fd6a4a395fbfdd767e648cc9.tar.gz
org.eclipse.cdt-5a2009648983ad93fd6a4a395fbfdd767e648cc9.tar.bz2
Bug 341632 - Trad mem rendering keyboard access
Change-Id: Iae09285e88f76d1155fd28a6aa25b818ae0164dd Reviewed-on: https://git.eclipse.org/r/11349 Reviewed-by: Chris Recoskie <recoskie@ca.ibm.com> IP-Clean: Chris Recoskie <recoskie@ca.ibm.com> Tested-by: Chris Recoskie <recoskie@ca.ibm.com>
-rwxr-xr-x[-rw-r--r--]memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/AbstractPane.java18
-rwxr-xr-x[-rw-r--r--]memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java6
2 files changed, 24 insertions, 0 deletions
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/AbstractPane.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/AbstractPane.java
index 3a7f94a..c99a7d0 100644..100755
--- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/AbstractPane.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/AbstractPane.java
@@ -229,6 +229,14 @@ public abstract class AbstractPane extends Canvas
editCell(fCaretAddress, fSubCellCaretPosition, ke.character);
}
+ else if (ke.keyCode == SWT.TAB && (ke.stateMask & SWT.SHIFT) != 0) {
+ // move backward cursor to the first position in the following pane
+ switchTo(fRendering.incrPane(AbstractPane.this,-1));
+ }
+ else if (ke.keyCode == SWT.TAB) {
+ // move forward cursor to the first position in the following pane
+ switchTo(fRendering.incrPane(AbstractPane.this,1));
+ }
if((ke.stateMask & SWT.SHIFT) != 0)
{
@@ -434,6 +442,16 @@ public abstract class AbstractPane extends Canvas
}
}
+ private void switchTo(AbstractPane pane)
+ {
+ pane.setCaretAddress(this.fCaretAddress);
+ pane.fOldSubCellCaretPosition = 0;
+ pane.fSubCellCaretPosition = 0;
+ pane.updateCaret();
+ pane.ensureCaretWithinViewport();
+ pane.setFocus();
+ }
+
protected boolean isPaneVisible()
{
return fPaneVisible;
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
index 848de2b..1575693 100644..100755
--- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
@@ -14,8 +14,10 @@ package org.eclipse.cdt.debug.ui.memory.traditional;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import java.util.Vector;
@@ -2259,4 +2261,8 @@ public class Rendering extends Composite implements IDebugEventSetListener
}
}
+ public AbstractPane incrPane(AbstractPane currentPane, int offset) {
+ final List<AbstractPane> panes = Arrays.asList(getRenderingPanes());
+ return panes.get((panes.indexOf(currentPane) + offset) % panes.size());
+ }
}