Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Zoom on gef shapes example
Zoom on gef shapes example [message #905419] Thu, 30 August 2012 06:59 Go to next message
Alexandre Pinheiro is currently offline Alexandre Pinheiro
Messages: 3
Registered: August 2012
Junior Member
hi,

I'm trying put zoom on GEF shapes example following this toturial:
eclipser-blog.blogspot.pt/2007/04/how-to-add-zoom-facility-to-gef-editor.html



I can zooming with scrool mouse, but i can't zooming with buttons on toolbar or on right-click menu..
i can see all the content appearing on the Menu, but i can't able to click on that Menu.

Someone help me?

regards
Alexandre

[Updated on: Thu, 30 August 2012 07:01]

Report message to a moderator

Re: Zoom on gef shapes example [message #910780 is a reply to message #905419] Mon, 10 September 2012 07:38 Go to previous message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi, you have register the actions in your editor:
@Override
protected void configureGraphicalViewer() {
    ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getGraphicalViewer().getRootEditPart()).getZoomManager();
    IAction zoomIn = new ZoomInAction(zoomManager);
    IAction zoomOut = new ZoomOutAction(zoomManager);
    getActionRegistry().registerAction(zoomIn);
    getActionRegistry().registerAction(zoomOut);
}


and in your ActionBarContributor, you have to add those actions to the menu:
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
	toolBarManager.add(getAction(GEFActionConstants.ZOOM_IN));
	toolBarManager.add(getAction(GEFActionConstants.ZOOM_OUT));

	String[] zoomStrings = new String[] {
			ZoomManager.FIT_ALL,
			ZoomManager.FIT_HEIGHT,
			ZoomManager.FIT_WIDTH
	};

	toolBarManager.add(new ZoomComboContributionItem(getPage(), zoomStrings));
}
Previous Topic:Blend Selection and Marquee
Next Topic:layout of nested elements with INestedContenProvider
Goto Forum:
  


Current Time: Thu Aug 28 19:14:46 EDT 2014

Powered by FUDForum. Page generated in 0.01562 seconds