public class PaletteViewerKeyHandler extends GraphicalViewerKeyHandler
Palette
.
Handles selection traversal of Palette entries and collapse/expand of
categories.Constructor and Description |
---|
PaletteViewerKeyHandler(PaletteViewer viewer)
Constructs a key handler for the specified palette viewer.
|
Modifier and Type | Method and Description |
---|---|
protected Point |
getNavigationPoint(IFigure figure)
Figures' navigation points are used to determine their direction compared
to one another, and the distance between them.
|
protected java.util.List |
getNavigationSiblings()
Returns the list of editparts which are conceptually at the same level of
navigation as the currently focused editpart.
|
boolean |
keyPressed(KeyEvent event)
Extends keyPressed to look for palette navigation keys.
|
protected void |
navigateTo(EditPart part,
KeyEvent event)
Navigates to the given EditPart
|
getFocusEditPart, getViewer, isViewerMirrored, processSelect
keyReleased, put, remove, setParent
public PaletteViewerKeyHandler(PaletteViewer viewer)
viewer
- the palette viewerprotected Point getNavigationPoint(IFigure figure)
figure
- the figure whose navigation point is to be returnedprotected java.util.List getNavigationSiblings()
GraphicalViewerKeyHandler
This implementation returns a list that contains the EditPart that has focus.
getNavigationSiblings
in class GraphicalViewerKeyHandler
EditParts
that can be
traversed to from the current
focus part
public boolean keyPressed(KeyEvent event)
keyPressed
in class GraphicalViewerKeyHandler
event
- the KeyEventtrue
if KeyEvent was handled in some wayKeyHandler.keyPressed(org.eclipse.swt.events.KeyEvent)
protected void navigateTo(EditPart part, KeyEvent event)
GraphicalViewerKeyHandler
navigateTo
in class GraphicalViewerKeyHandler
part
- the EditPart to navigate toevent
- the KeyEvent that triggered this traversalGraphicalViewerKeyHandler.navigateTo(EditPart, KeyEvent)
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.