Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Adding children, to a nested rectangle.
Adding children, to a nested rectangle. [message #658963] Thu, 10 March 2011 09:54 Go to next message
Eclipse UserFriend
Hi,

Suppose, I want to be able to add children to a rectangle which is
nested into another rectangle. Normally, this is not possible, as the
contentPane is always the parent rectangle. In order to make is possible
I am doing this in the editpart:

(I override getContentPane to return a child rectangle, produced with a
child access).


public IFigure getContentPane() {
if (contentPane != null) {
if(contentPane instanceof CabinetFigure){
return ((CabinetFigure)contentPane).getFigureSubrackContainer();
}
}
return super.getContentPane();
}


Is this somehow possible with GMF Tooling? I noticed, a Node has a
property named: Content Pane. Setting this to a child access to a nested
rectangle, doesn't seem to change the generated edit part.

Thanks, Christophe Bouhier
Re: Adding children, to a nested rectangle. [message #659153 is a reply to message #658963] Fri, 11 March 2011 05:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Do you want to have a figure which is made of 2 rectangles (one inner and one container), but which will be a single editPart, or do you want to have the first rectangle an editPart which will contain another editPart as an inner rectangle?
For the first use case, that would be simply about defining the figure correctly in the gmfgraph;
For the second use case, that would be simple containment using ChildReference for your node mapping in gmfmap.

HTH

--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
Re: Adding children, to a nested rectangle. [message #659345 is a reply to message #659153] Sat, 12 March 2011 09:22 Go to previous message
Eclipse UserFriend
On 11-03-11 11:07, Mickael Istria wrote:
> Hi,
>
> Do you want to have a figure which is made of 2 rectangles (one inner
> and one container), but which will be a single editPart,
or do you want
> to have the first rectangle an editPart which will contain another
> editPart as an inner rectangle?
> For the first use case, that would be simply about defining the figure
> correctly in the gmfgraph;
> For the second use case, that would be simple containment using
> ChildReference for your node mapping in gmfmap.
>
Thanks Mickael, I try to avoid containments. I have no requirements for
collapsible, and even if I turn it off, I will have limited options for
layouts. (As containments only support a ListLayout or a XYLayout).

> HTH
>
Previous Topic:Creation of three nodes with a unique tool in a concrete location
Next Topic:[Validation] NoSuchMethodError in exported plugin
Goto Forum:
  


Current Time: Thu Jul 03 19:49:41 EDT 2025

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

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

Back to the top