1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16:02 +02:00

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>
This commit is contained in:
congwang 2013-03-21 12:55:04 -04:00 committed by Chris Recoskie
parent d11a8c4902
commit 440e2e87bf
2 changed files with 24 additions and 0 deletions

View file

@ -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;

View file

@ -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());
}
}