锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲久草在线视频,久久一区二区三区超碰国产精品,成人h动漫精品一区二区http://www.aygfsteel.com/lucia/category/3261.htmlzh-cnThu, 08 Mar 2007 02:40:28 GMTThu, 08 Mar 2007 02:40:28 GMT60How to add zoom function into your eclipse plugin?http://www.aygfsteel.com/lucia/archive/2005/10/25/16814.htmllucialuciaTue, 25 Oct 2005 15:38:00 GMThttp://www.aygfsteel.com/lucia/archive/2005/10/25/16814.htmlhttp://www.aygfsteel.com/lucia/comments/16814.htmlhttp://www.aygfsteel.com/lucia/archive/2005/10/25/16814.html#Feedback0http://www.aygfsteel.com/lucia/comments/commentRss/16814.htmlhttp://www.aygfsteel.com/lucia/services/trackbacks/16814.html
1. Add the action into the toolbar:
...in Class: ActionBarContributor...
...in Method: contributeToToolBar...
toolBarManager.add(getAction(GEFActionConstants.ZOOM_IN));
toolBarManager.add(getAction(GEFActionConstants.ZOOM_OUT));
toolBarManager.add(new ZoomComboContributionItem(getPage()));
2. Connect the Zoom Manager with your edit part:
...in Class: YourEditor...
...in Method: configureGraphicalViewer...
ScalableFreeformRootEditPart rootEditPart= new ScalableFreeformRootEditPart();
getGraphicalViewer().setRootEditPart(rootEditPart);
ZoomManager manager = rootEditPart.getZoomManager();
IAction action = new ZoomInAction(manager);
getActionRegistry().registerAction(action);
action = new ZoomOutAction(manager);
getActionRegistry().registerAction(action);
//define the zoom possibilities
double[] zoomLevels = new double[] {0.25,0.5,0.75,1.0,1.5,2.0,2.5,3.0,4.0};
manager.setZoomLevels(zoomLevels);
...in Method: getAdapter...
if (type == ZoomManager.class)
return ((ScalableFreeformRootEditPart)
getGraphicalViewer().
getRootEditPart()).getZoomManager();
That's all! Now you have two buttons to zoom in and zoom out. And you
can see the zoom level in percent. With the example here
you can change zoom level from 25% to 400%.