[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.gmf] Re: "List" layout on canvas
|
Hi,
I progressed... a little.
I try with :
mfgen-> gen editor generator -> gen diagram -> figure view map -> layout
type
: TOOLBAR_LAYOUT
You need to overwrite the following figure of your diagram edit part:
protected IFigure createFigure() {
FreeformLayer l = new FreeformLayer();
l.setBorder(new MarginBorder(50));
ToolbarLayout lm = new ToolbarLayout();
lm.setSpacing(10);
l.setLayoutManager(lm);
return l;
}
(and don't forget to set the @generatednot tag, otherwise you loose your
configuration after regenerating the diagram editor)
and another issue is that I can't add an EditPolicy which affect the
canvas between each EditPart which constitutes line. I can only apply it
on each EditPart and so inside each of them.
By setting the spacing (lm.setSpacing(10)) you can affect those.
But the new element are always added at the end of the canvas.
See GMF Recipes "HowTo add children in a GMF compartment at a specific
position" at:
http://wiki.eclipse.org/GMF/Recipes
Another hint: If you want to do the same for compartments set the
listLayout attribute (GMFGen) and again overwrite the createFigure method.
Cheers,
sas