Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » gmfgraph -> Node -> Content Pane
gmfgraph -> Node -> Content Pane [message #645125] Wed, 15 December 2010 16:21 Go to next message
Eclipse UserFriend
Originally posted by: marius.groeger.googlemail.com

Hello,

in a figure (rectangle) I have a simple GridLayout and two children, the
label and another rectangle. Now I want children of this element to live
inside that nested rectangle (I think this is what Alex Shatalin meant
in [1])

+---------------+
| Label |
| +-----------+ |
| | | |
| | Container | |
| | for | |
| | Children | |
| | | |
| +-----------+ |
+---------------+

I thought I could tell the generator this via the Node -> Content Pane
attribute. This accepts a child accessor, which I created for my nested
rectangle. However the diagram still wants to place children in the main
rectangle. If I add this to createNodeFigure() in my EditPart:

contentPane = setupContentPane(shape);
contentPane = ((MyFigure)contentPane).getFigureContainerArea();

then it actually works! (The nested rectangle uses an XY layout, and
when I move a child I get this strange 'phantom' feedback rectangles
that don't go away, but this is probably a different problem).

So what is the matter with Content Pane - is it supposed to work, and if
so, how?

I do not want to use Compartments, as I had different layout and design
problems with those in the past.

Thanks
Marius

[1] http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg12818.html
Re: gmfgraph -> Node -> Content Pane [message #645757 is a reply to message #645125] Mon, 20 December 2010 12:33 Go to previous messageGo to next message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
Registered: July 2009
Senior Member
Hello,

To my understanding it is not supported by the generation yet, so the only way to fix it right now is to write @generated NOT code like your one.

(Personally I would prefer to create @generated NOT version of the setupContentPane but thats a peronal preference).

I am not sure we have the Bugzilla for that though, please feel free to submit one.

Regards
Michael

Re: gmfgraph -> Node -> Content Pane [message #645914 is a reply to message #645757] Tue, 21 December 2010 07:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marius.groeger.googlemail.com

Michael,

On 20.12.2010 13:33, Michael Golubev wrote:
> To my understanding it is not supported by the generation yet, so the
> only way to fix it right now is to write @generated NOT code like your one.
> (Personally I would prefer to create @generated NOT version of the
> setupContentPane but thats a peronal preference).
> I am not sure we have the Bugzilla for that though, please feel free to
> submit one.

Thanks for the reply, I was afraid you were in your winter break already :-)

You're right about the location of a fix, I merely did it that way to
show the nesting error.

I don't much like the @generated NOT approach, because even though the
generator preserves those changes, I loose the possibilty to re-generate
everything from scratch. Using Providers is much more elegant I find,
and IMHO also more 'Eclipse style'. But I don't see a way to archive
this without touching the code. Do you have an idea?

I haven't checked this one, but unfortunatly, most of the time I found
the template approach barely usable, because it forces you to pull in
much more stuff than what you actually want to modify. More fine grained
template atoms would be great wrt this.

Regards
Marius
Re: gmfgraph -> Node -> Content Pane [message #645941 is a reply to message #645914] Tue, 21 December 2010 09:46 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Eclipse User wrote on Tue, 21 December 2010 08:48

I don't much like the @generated NOT approach, because even though the
generator preserves those changes, I loose the possibilty to re-generate
everything from scratch. Using Providers is much more elegant I find,
and IMHO also more 'Eclipse style'. But I don't see a way to archive
this without touching the code. Do you have an idea?


You can take a look here: see here

In fact, register a customEditPartProvider via org.eclipse.gmf.runtime.diagram.ui.editpartProviders which will use a CustomEditPartFactory that will redirect to CustomXXXEditPart tha extends XXXEditPart


Eclipse User wrote on Tue, 21 December 2010 08:48

I haven't checked this one, but unfortunatly, most of the time I found
the template approach barely usable, because it forces you to pull in
much more stuff than what you actually want to modify. More fine grained
template atoms would be great wrt this.



Do you think to use aspect templates? It often allows you to modify just few lines of the template
see here: http://www.bonitasoft.org/blog/eclipse/customize-your-gmf-ed itor-by-customizing-templates/


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team

[Updated on: Tue, 21 December 2010 09:59]

Report message to a moderator

Re: gmfgraph -> Node -> Content Pane [message #645951 is a reply to message #645941] Tue, 21 December 2010 10:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marius.groeger.googlemail.com

On 21.12.2010 10:46, Aurelien Pupier wrote:
>
> Eclipse User wrote on Tue, 21 December 2010 08:48
>> I don't much like the @generated NOT approach, because even though the
>> generator preserves those changes, I loose the possibilty to
>> re-generate everything from scratch. Using Providers is much more
>> elegant I find, and IMHO also more 'Eclipse style'. But I don't see a
>> way to archive this without touching the code. Do you have an idea?
>
> You can take a look here:
> http://www.bonitasoft.org/websvn/listing.php?repname=Bonita+ Open+Solution&path=/bonita-studio/branches/bonita-studio -5.3.2/plugins/org.bonitasoft.studio.diagram.custom/#path_bo nita-studio_branches_bonita-studio-5.3.2_plugins_org.bonitas oft.studio.diagram.custom_
>
>
> In fact, register a customEditPartProvider via
> org.eclipse.gmf.runtime.diagram.ui.editpartProviders which will use a
> CustomEditPartFactory that will redirect to CustomXXXEditPart tha
> extends XXXEditPart

This sounds very interesting! How do I disable the original Edit Part in
this case? Or will the custom provider automatically override the
existing one?

>> I haven't checked this one, but unfortunatly, most of the time I found
>> the template approach barely usable, because it forces you to pull in
>> much more stuff than what you actually want to modify. More fine
>> grained template atoms would be great wrt this.
>
>
> Do you think to use aspect templates? It often allows you to modify just
> few lines of the template
> see here:

Yes, of course. It works perfect for the 'additions' hooks. But to give
you an example: I needed to modify the addFixedChild() method for some
of my elements. For this I had to pull in quite a lot of existing
template code.

Regards
Marius
Re: gmfgraph -> Node -> Content Pane [message #645954 is a reply to message #645951] Tue, 21 December 2010 10:31 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Eclipse User wrote on Tue, 21 December 2010 11:06
Originally posted by: marius.groeger.googlemail.com

On 21.12.2010 10:46, Aurelien Pupier wrote:
>
> Eclipse User wrote on Tue, 21 December 2010 08:48
>> I don't much like the @generated NOT approach, because even though the
>> generator preserves those changes, I loose the possibilty to
>> re-generate everything from scratch. Using Providers is much more
>> elegant I find, and IMHO also more 'Eclipse style'. But I don't see a
>> way to archive this without touching the code. Do you have an idea?
>
> You can take a look here:
> http://www.bonitasoft.org/websvn/listing.php?repname=Bonita+ Open+Solution&path=/bonita-studio/branches/bonita-studio -5.3.2/plugins/org.bonitasoft.studio.diagram.custom/#path_bo nita-studio_branches_bonita-studio-5.3.2_plugins_org.bonitas oft.studio.diagram.custom_
>
>
> In fact, register a customEditPartProvider via
> org.eclipse.gmf.runtime.diagram.ui.editpartProviders which will use a
> CustomEditPartFactory that will redirect to CustomXXXEditPart tha
> extends XXXEditPart

This sounds very interesting! How do I disable the original Edit Part in
this case? Or will the custom provider automatically override the
existing one?



The custom Provider will override the existing one

Eclipse User wrote on Tue, 21 December 2010 11:06

>> I haven't checked this one, but unfortunatly, most of the time I found
>> the template approach barely usable, because it forces you to pull in
>> much more stuff than what you actually want to modify. More fine
>> grained template atoms would be great wrt this.
>
>
> Do you think to use aspect templates? It often allows you to modify just
> few lines of the template
> see here:

Yes, of course. It works perfect for the 'additions' hooks. But to give
you an example: I needed to modify the addFixedChild() method for some
of my elements. For this I had to pull in quite a lot of existing
template code.



Yes, that's why I said only "often". In some cases, you're right this is quite heavy. But we are free to open a feature request to GMF Tooling and to provide a patch to have a better split Smile

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: gmfgraph -> Node -> Content Pane [message #645961 is a reply to message #645951] Tue, 21 December 2010 10:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marius.groeger.googlemail.com

On 21.12.2010 11:06, Marius Gröger wrote:
>> In fact, register a customEditPartProvider via
>> org.eclipse.gmf.runtime.diagram.ui.editpartProviders which will use a
>> CustomEditPartFactory that will redirect to CustomXXXEditPart tha
>> extends XXXEditPart
>
> This sounds very interesting! How do I disable the original Edit Part in
> this case? Or will the custom provider automatically override the
> existing one?

Got it, the providers are prioritized so the custom one can easily
override the generated one.
Re: gmfgraph -> Node -> Content Pane [message #645987 is a reply to message #645941] Tue, 21 December 2010 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marius.groeger.googlemail.com

On 21.12.2010 10:46, Aurelien Pupier wrote:
> In fact, register a customEditPartProvider via
> org.eclipse.gmf.runtime.diagram.ui.editpartProviders which will use a
> CustomEditPartFactory that will redirect to CustomXXXEditPart tha
> extends XXXEditPart

Btw, how do you export the original EditParts in the generated plugin?
I'm using some ugly Ant <replace/> logic, is there a better way?

Regards,
Marius
Re: gmfgraph -> Node -> Content Pane [message #645988 is a reply to message #645987] Tue, 21 December 2010 13:36 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Eclipse User wrote on Tue, 21 December 2010 14:31
Originally posted by: marius.groeger.googlemail.com

On 21.12.2010 10:46, Aurelien Pupier wrote:
> In fact, register a customEditPartProvider via
> org.eclipse.gmf.runtime.diagram.ui.editpartProviders which will use a
> CustomEditPartFactory that will redirect to CustomXXXEditPart tha
> extends XXXEditPart

Btw, how do you export the original EditParts in the generated plugin?
I'm using some ugly Ant <replace/> logic, is there a better way?

Regards,
Marius


The package is exported by default.
Perhaps you are using an older version?


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: gmfgraph -> Node -> Content Pane [message #646017 is a reply to message #645988] Tue, 21 December 2010 14:14 Go to previous message
Eclipse UserFriend
Originally posted by: marius.groeger.googlemail.com

On 21.12.2010 14:36, Aurelien Pupier wrote:
> The package is exported by default.
> Perhaps you are using an older version?

You are right, of course. In the process of moving toward using Edit
Part Providers, I reviewed my manual post processing and mistook the
reference to the XXX.edit.parts package - I was using it as a marker to
insert another export (XXX.sheet). Sorry to have bothered you with this,
I should have looked closer.

Anyway I'm banging may head against the wall for not earlier have
discovered edit part providers.

Regards
Marius
Previous Topic:Multiple EditParts for one semantic element
Next Topic:problem with generated rcp diagram plugin not activated
Goto Forum:
  


Current Time: Wed Sep 25 06:34:17 GMT 2024

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

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

Back to the top