Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse GEF
3.3

org.eclipse.gef.ui.parts
Class GraphicalViewerKeyHandler

java.lang.Object
  extended by

org.eclipse.gef.KeyHandler
      extended by
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:

  • Arrow Keys (UP, DOWN, LEFT, RIGHT) with optional SHIFT and CONTROL modifiers
  • Arrow Keys (UP, DOWN) same as above, but with ALT modifier.
  • '\'Backslash and '/' Slash keys with optional SHIFT and CONTROL modifiers

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   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.
 
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

getFocusEditPart

protected 
GraphicalEditPart getFocusEditPart()
Returns:
the EditPart that has focus

getNavigationSiblings

protected java.util.List getNavigationSiblings()
Returns the list of editparts which are conceptually at the same level of navigation as the currently focused editpart. By default, these are the siblings of the focused part.

This implementation returns a list that contains the EditPart that has focus.

Returns:
a list of navigation editparts
Since:
3.4

getViewer

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

Returns:
the viewer

isViewerMirrored

protected boolean isViewerMirrored()
Returns:
true if the viewer is mirrored
Since:
3.4

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:
org.eclipse.gef.KeyHandler#keyPressed(org.eclipse.swt.events.KeyEvent)

navigateTo

protected void navigateTo(
EditPart part,
                          KeyEvent event)
Navigates to the given EditPart

Parameters:
part - the EditPart to navigate to
event - the KeyEvent that triggered this traversal

processSelect

protected void processSelect(KeyEvent event)
This method is invoked when the user presses the space bar. It toggles the selection of the EditPart that currently has focus.

Parameters:
event - the key event received

Eclipse GEF
3.3

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

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire