Skip to main content


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 10:59 Go to next message
Alexandre Pinheiro is currently offline Alexandre PinheiroFriend
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 11:01]

Report message to a moderator

Re: Zoom on gef shapes example [message #910780 is a reply to message #905419] Mon, 10 September 2012 11:38 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
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: Wed Apr 24 18:55:46 GMT 2024

Powered by FUDForum. Page generated in 0.02490 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top