Eclipse GEF
2.1

org.eclipse.gef.ui.parts
Class GraphicalViewerKeyHandler

java.lang.Object
  |
  +--org.eclipse.gef.KeyHandler
        |
        +--org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler
Direct Known Subclasses:
PaletteViewerKeyHandler

public class GraphicalViewerKeyHandler
extends KeyHandler

An extended KeyHandler which processes default keystrokes for common navigation in a GraphicalViewer. This class can be used as a KeyHandler too; Unrecognized keystrokes are sent to the super's implementation. This class will process key events containing the following:

All processed key events will do nothing other than change the selection and/or focus editpart for the viewer.


Constructor Summary
GraphicalViewerKeyHandler(GraphicalViewer viewer)
          Constructs a key handler for the given viewer.
 
Method Summary
protected  GraphicalViewer getViewer()
          Returns the viewer on which this key handler was created.
 boolean keyPressed(KeyEvent event)
          Extended to process key events described above.
 
Methods inherited from class org.eclipse.gef.KeyHandler
keyReleased, put, remove, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicalViewerKeyHandler

public GraphicalViewerKeyHandler(GraphicalViewer viewer)
Constructs a key handler for the given viewer.

Parameters:
viewer - the viewer
Method Detail

getViewer

protected GraphicalViewer getViewer()
Returns the viewer on which this key handler was created.

Returns:
the viewer

keyPressed

public boolean keyPressed(KeyEvent event)
Extended to process key events described above.

Overrides:
keyPressed in class KeyHandler
Parameters:
event - the KeyEvent
Returns:
true if KeyEvent was handled in some way
See Also:
KeyHandler.keyPressed(org.eclipse.swt.events.KeyEvent)

Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.