Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Prevent duplicate Classes for Child References?
Prevent duplicate Classes for Child References? [message #50680] Tue, 19 September 2006 06:11 Go to next message
Eclipse UserFriend
Originally posted by: tobk.gmx.de

Hello,

is there a way to prevent the duplicate (?) EditParts, EditPolicies,
ViewFactories etc. for Child References (e.g. for States that are contained
in other States)?

When I took a look at the classes I couldn't find any differences (except
for the '2' in the classes and most of the referenced classes names).
However, when I manually deleted the 'duplicates' and bent the references
to the 'originals' the Diagram Editor didn't work anymore.

Can you tell me why there have to be these (neary?) duplicates, since a
state that is contained in a state should have the same behaviour as a
state that is placed on the top level?

It would be really annoying if I had to copy all the changes I had to do on
the EditParts to their duplicates (like for 7 types of nodes in my actual
project...).

Regards,
tobias
Re: Prevent duplicate Classes for Child References? [message #50708 is a reply to message #50680] Tue, 19 September 2006 06:27 Go to previous messageGo to next message
Eclipse UserFriend
Hello Tobias,

This question was discussed here: http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00825.html
In addition I hope the following request should solve your problems: https://bugs.eclipse.org/bugs/show_bug.cgi?id=157683


-----------------
Alex Shatalin
Re: Prevent duplicate Classes for Child References? [message #50904 is a reply to message #50708] Tue, 19 September 2006 08:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk.gmx.de

Alex Shatalin wrote:

> Hello Tobias,
>
> This question was discussed here:
> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00825.html
> In addition I hope the following request should solve your problems:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=157683
>
>
> -----------------
> Alex Shatalin

Thank you for the reference.

The abstract-superclass-workaround seems to work out quite good. Here's what
I did:

- I created an abstract superclass for the edit part(s) that holds only my
@generated NOT methods, like notifyChanged()
- I externalized the nested Figure class and made a reference on it via a
custom figure in GMF

I put them in a different package, so I don't even have to see the
duplicates. :-) A nice side effect of this is that everything is much
clearer, with the figure and the custom changes in seperate classes.

But I'm somewhat surprised that everything works (seems to?) after the first
try, so please correct me if a made some terrible mistake that might turn
out bad later on...

Thanks,
tobias
Re: Prevent duplicate Classes for Child References? [message #51044 is a reply to message #50904] Tue, 19 September 2006 08:42 Go to previous messageGo to next message
Eclipse UserFriend
Hello Tobias,

> @generated NOT methods, like notifyChanged()
Did you move some other common methods to this super-class?

> first try, so please correct me if a made some terrible mistake that
> might turn out bad later on...
All the modifications looks perfect. ;-)

-----------------
Alex Shatalin
Re: Prevent duplicate Classes for Child References? [message #51127 is a reply to message #51044] Tue, 19 September 2006 09:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk.gmx.de

Alex Shatalin wrote:

> Hello Tobias,
>
>> @generated NOT methods, like notifyChanged()
> Did you move some other common methods to this super-class?

Only an abstract stub for getPrimaryShape, because I need it in the
notifyChanged implementation.

>> first try, so please correct me if a made some terrible mistake that
>> might turn out bad later on...
> All the modifications looks perfect. ;-)

.... but now I encounter some problems: While it works well for my "Events"
and "Gateways", it doesn't for the "Tasks". Task, in contrast to the
others, have internal Labels.

I moved the TaskNameLabelFigure inside the CustomTaskFigure and removed the
fields and methods generated by the old LabelFigure from the custom
TaskFigure Code. A new TaskFigure extending the Custom Figure is generated
in the concrete TaskEditPart, holding the label now. So far, so good.

But when I edit the task's name, the default-text ("<...>") stay visble
behind the name, meaning that there must be _two_ labels in the figure, but
i can't figure out why. Of course I could simply remove the default text,
making the second label invisible, but you surely understand that I
wouldn't like this very much...

Do you have any Idea where there could be the problem? Meanwhile, I'll try
with debuggung and inspecting the figure object...

Tobias
Re: Prevent duplicate Classes for Child References? [message #51155 is a reply to message #51127] Tue, 19 September 2006 09:41 Go to previous message
Eclipse UserFriend
Originally posted by: tobk.gmx.de

tobias wrote:

> Do you have any Idea where there could be the problem? Meanwhile, I'll try
> with debuggung and inspecting the figure object...

OK, I got the cause. There was a redundant call to createContents, creating
the label twice. Now everything seems to work as it should.

Tobias
Previous Topic:gmf-v-gef
Next Topic:Automatic update yields file not found errors
Goto Forum:
  


Current Time: Thu May 08 19:17:16 EDT 2025

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

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

Back to the top