Adding children, to a nested rectangle. [message #658963] |
Thu, 10 March 2011 14:54 |
Christophe Bouhier 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 |
|
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 |
Christophe Bouhier 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
>
|
|
|
Powered by
FUDForum. Page generated in 0.04897 seconds