Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:54 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
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 10:07 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

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 14:22 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
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 Mar 28 17:40:21 GMT 2024

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

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

Back to the top