org.eclipse.gef.ui.parts
Class PaletteViewerKeyHandler

java.lang.Object
  extended byorg.eclipse.gef.KeyHandler
      extended byorg.eclipse.gef.ui.parts.GraphicalViewerKeyHandler
          extended byorg.eclipse.gef.ui.parts.PaletteViewerKeyHandler

public class PaletteViewerKeyHandler
extends GraphicalViewerKeyHandler

KeyHandler for the Palette. Handles selection traversal of Palette entries and collapse/expand of categories.


Constructor Summary
PaletteViewerKeyHandler(PaletteViewer viewer)
          Constructs a key handler for the specified palette viewer.
 
Method Summary
protected  org.eclipse.draw2d.geometry.Point getNavigationPoint(org.eclipse.draw2d.IFigure figure)
           
protected  java.util.List getNavigationSiblings()
           
 boolean keyPressed(org.eclipse.swt.events.KeyEvent event)
          Extends keyPressed to look for palette navigation keys.
protected  void navigateTo(EditPart part, org.eclipse.swt.events.KeyEvent event)
          Navigates to the given EditPart
 
Methods inherited from class org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler
getFocusEditPart, getViewer, processSelect
 
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

PaletteViewerKeyHandler

public PaletteViewerKeyHandler(PaletteViewer viewer)
Constructs a key handler for the specified palette viewer.

Parameters:
viewer - the palette viewer
Method Detail

getNavigationPoint

protected org.eclipse.draw2d.geometry.Point getNavigationPoint(org.eclipse.draw2d.IFigure figure)
Returns:
the center of the given figure
See Also:
GraphicalViewerKeyHandler#getNavigationPoint(IFigure)

getNavigationSiblings

protected java.util.List getNavigationSiblings()
Returns:
a list of EditParts that can be traversed to from the current focus part

keyPressed

public boolean keyPressed(org.eclipse.swt.events.KeyEvent event)
Extends keyPressed to look for palette navigation keys.

Overrides:
keyPressed in class GraphicalViewerKeyHandler
See Also:
KeyHandler.keyPressed(org.eclipse.swt.events.KeyEvent)

navigateTo

protected void navigateTo(EditPart part,
                          org.eclipse.swt.events.KeyEvent event)
Description copied from class: GraphicalViewerKeyHandler
Navigates to the given EditPart

Overrides:
navigateTo in class GraphicalViewerKeyHandler
Parameters:
part - the EditPart to navigate to
event - the KeyEvent that triggered this traversal
See Also:
GraphicalViewerKeyHandler.navigateTo(EditPart, KeyEvent)