*/
@Override
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
GraphicalViewer viewer = getGraphicalViewer();
/*
// TODO Graphiti
viewer.setEditPartFactory(new RouteEditPartFactory());
double[] zoomLevels;
ArrayList<String> zoomContributions;
rootEditPart = new ScalableRootEditPart();
viewer.setRootEditPart(rootEditPart);
ZoomManager manager = rootEditPart.getZoomManager();
getActionRegistry().registerAction(new ZoomInAction(manager));
getActionRegistry().registerAction(new ZoomOutAction(manager));
// zooms possible. 1 = 100%
zoomLevels = new double[] { 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0,
4.0, 5.0, 10.0, 20.0 };
manager.setZoomLevels(zoomLevels);
zoomContributions = new ArrayList<String>();
zoomContributions.add(ZoomManager.FIT_ALL);
zoomContributions.add(ZoomManager.FIT_HEIGHT);
zoomContributions.add(ZoomManager.FIT_WIDTH);
manager.setZoomLevelContributions(zoomContributions);
KeyHandler keyHandler = new KeyHandler();
keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0),
getActionRegistry().getAction(ActionFactory.DELETE.getId()));
keyHandler.put(KeyStroke.getPressed('+', SWT.KEYPAD_ADD, 0),
getActionRegistry().getAction(GEFActionConstants.ZOOM_IN));
keyHandler.put(KeyStroke.getPressed('-', SWT.KEYPAD_SUBTRACT, 0),
getActionRegistry().getAction(GEFActionConstants.ZOOM_OUT));
viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.NONE),
MouseWheelZoomHandler.SINGLETON);
viewer.setKeyHandler(keyHandler);
// IMPORTANT: the following is a dirty workaround to get the delete
// action behave normal. Without this code no delete will be
// possible. TODO: try to get this fixed by time.
ActionRegistry registry = getActionRegistry();
String id = ActionFactory.UNDO.getId();
getEditorSite().getKeyBindingService().registerAction(
registry.getAction(id));
id = ActionFactory.REDO.getId();
getEditorSite().getKeyBindingService().registerAction(
registry.getAction(id));
id = ActionFactory.DELETE.getId();
getEditorSite().getKeyBindingService().registerAction(
registry.getAction(id));
*/
ContextMenuProvider provider = new RiderEditorContextMenuProvider(this, this, viewer, getActionRegistry());
viewer.setContextMenu(provider);
}