public class GraphicalViewerKeyHandler extends KeyHandler
All processed key events will do nothing other than change the selection and/or focus editpart for the viewer.
Constructor and Description |
---|
GraphicalViewerKeyHandler(GraphicalViewer viewer)
Constructs a key handler for the given viewer.
|
Modifier and Type | Method and Description |
---|---|
protected GraphicalEditPart |
getFocusEditPart() |
protected java.util.List |
getNavigationSiblings()
Returns the list of editparts which are conceptually at the same level of
navigation as the currently focused editpart.
|
protected GraphicalViewer |
getViewer()
Returns the viewer on which this key handler was created.
|
protected boolean |
isViewerMirrored() |
boolean |
keyPressed(KeyEvent event)
Extended to process key events described above.
|
protected void |
navigateTo(EditPart part,
KeyEvent event)
Navigates to the given EditPart
|
protected void |
processSelect(KeyEvent event)
This method is invoked when the user presses the space bar.
|
keyReleased, put, remove, setParent
public GraphicalViewerKeyHandler(GraphicalViewer viewer)
viewer
- the viewerprotected GraphicalEditPart getFocusEditPart()
protected java.util.List getNavigationSiblings()
This implementation returns a list that contains the EditPart that has focus.
protected GraphicalViewer getViewer()
protected boolean isViewerMirrored()
true
if the viewer is mirroredpublic boolean keyPressed(KeyEvent event)
keyPressed
in class KeyHandler
event
- the KeyEventtrue
if KeyEvent was handled in some wayKeyHandler.keyPressed(org.eclipse.swt.events.KeyEvent)
protected void navigateTo(EditPart part, KeyEvent event)
part
- the EditPart to navigate toevent
- the KeyEvent that triggered this traversalprotected void processSelect(KeyEvent event)
event
- the key event receivedCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.