Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Troubles with layouts(FlowLayout and ToolbarLayout)
Troubles with layouts [message #1005733] Mon, 28 January 2013 13:08
El Arbi Aboussoror is currently offline El Arbi Aboussoror
Messages: 90
Registered: June 2010
Member
Hi,

I have problem with this code:

public class ObjectStroryEditPart extends AbstractGraphicalEditPart {

	public ObjectStroryEditPart(ObjectStory model) {
		setModel(model);
	}
	public ObjectStory getModel() {
		return (ObjectStory) super.getModel();
	}
	@Override
	protected IFigure createFigure() {
		
//		Figure figure = new Figure(); // nothing appears !
		Figure figure = new FreeformLayer();
		
		FlowLayout flayout = new FlowLayout(); //works but more than one child figure per row!
		flayout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
				
		ToolbarLayout layout = new ToolbarLayout();  // works but the width is not constant!
		figure.setLayoutManager(layout);
		
		return figure;
	}
	

	/**
	 * Return a collection of top level genealogy model objects to be displayed
	 */
	protected List<Shot> getModelChildren() {
		return getModel().getShots();
	}
	protected void createEditPolicies() {
	}

}


When I set the layout to FlowLayout I have more than one child that is displayed in a row. I was expecting only one child, since the Flowlayout is horizontal.
With a ToolbarLayout it works better but then I have a problem with the width of the children that span the whole view.

[Updated on: Fri, 01 February 2013 21:57]

Report message to a moderator

Previous Topic:Creating a "Mini" View
Next Topic:Direct Edit with copy/paste
Goto Forum:
  


Current Time: Fri Sep 19 03:50:46 GMT 2014

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

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