summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcongwang2013-03-21 12:55:04 (EDT)
committer Chris Recoskie2013-03-22 12:22:48 (EDT)
commit440e2e87bf830f594e20e54f690d00f4cc1287c8 (patch)
tree4a5370d60ec2d35df18049f4ad80072fc4d598af
parentd11a8c4902eaafe7a6c65784ba65e1856bb42591 (diff)
downloadorg.eclipse.cdt-440e2e87bf830f594e20e54f690d00f4cc1287c8.zip
org.eclipse.cdt-440e2e87bf830f594e20e54f690d00f4cc1287c8.tar.gz
org.eclipse.cdt-440e2e87bf830f594e20e54f690d00f4cc1287c8.tar.bz2
Bug 341632 - Trad mem rendering keyboard accessrefs/changes/49/11349/8
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());
+ }
}