Package org.eclipse.gef.ui.parts
Class PaletteViewerKeyHandler
- java.lang.Object
-
- org.eclipse.gef.KeyHandler
-
- org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler
-
- org.eclipse.gef.ui.parts.PaletteViewerKeyHandler
-
public class PaletteViewerKeyHandler extends GraphicalViewerKeyHandler
KeyHandler for thePalette. Handles selection traversal of Palette entries and collapse/expand of categories.
-
-
Constructor Summary
Constructors Constructor Description PaletteViewerKeyHandler(PaletteViewer viewer)Constructs a key handler for the specified palette viewer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.draw2d.geometry.PointgetNavigationPoint(org.eclipse.draw2d.IFigure figure)Figures' navigation points are used to determine their direction compared to one another, and the distance between them.protected java.util.ListgetNavigationSiblings()Returns the list of editparts which are conceptually at the same level of navigation as the currently focused editpart.booleankeyPressed(KeyEvent event)Extends keyPressed to look for palette navigation keys.protected voidnavigateTo(EditPart part, KeyEvent event)Navigates to the given EditPart-
Methods inherited from class org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler
getFocusEditPart, getViewer, isViewerMirrored, processSelect
-
Methods inherited from class org.eclipse.gef.KeyHandler
keyReleased, put, remove, setParent
-
-
-
-
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)
Figures' navigation points are used to determine their direction compared to one another, and the distance between them.- Parameters:
figure- the figure whose navigation point is to be returned- Returns:
- the top-left of the given figure
-
getNavigationSiblings
protected java.util.List getNavigationSiblings()
Description copied from class:GraphicalViewerKeyHandlerReturns 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.
- Overrides:
getNavigationSiblingsin classGraphicalViewerKeyHandler- Returns:
- a list of
EditPartsthat can be traversed to from the currentfocus part
-
keyPressed
public boolean keyPressed(KeyEvent event)
Extends keyPressed to look for palette navigation keys.- Overrides:
keyPressedin classGraphicalViewerKeyHandler- Parameters:
event- the KeyEvent- Returns:
trueif KeyEvent was handled in some way- See Also:
KeyHandler.keyPressed(org.eclipse.swt.events.KeyEvent)
-
navigateTo
protected void navigateTo(EditPart part, KeyEvent event)
Description copied from class:GraphicalViewerKeyHandlerNavigates to the given EditPart- Overrides:
navigateToin classGraphicalViewerKeyHandler- Parameters:
part- the EditPart to navigate toevent- the KeyEvent that triggered this traversal- See Also:
GraphicalViewerKeyHandler.navigateTo(EditPart, KeyEvent)
-
-