Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Retrieve semantic container for a relationship
Retrieve semantic container for a relationship [message #33455] Tue, 29 August 2006 19:11 Go to next message
Eclipse UserFriend
Hello everybody,


I still have the following problem:
I have an UML editor that also features packages and associations (i.e.
some specialized relationships).

Now, whenever I drag&drop some two classes that are connected via an
association edge onto a package compartment the classes are semantically
moved to that package but the assoc is not!

I would expect to have to override some "getRelationshipContainer()"
method.

Is that correct?
What else do you suggest?

Thanks a lot in advance,

Martin



PS:
Mostafa replied to my original request but I suppose that I didn't state
my problem well. That's why I'm posting this "2nd attempt" ;-)
Re: Retrieve semantic container for a relationship [message #34351 is a reply to message #33455] Wed, 30 August 2006 09:48 Go to previous messageGo to next message
Eclipse UserFriend
Hello Martin,

> Now, whenever I drag&drop some two classes that are connected via an
> association edge onto a package compartment the classes are
> semantically moved to that package but the assoc is not!
> I would expect to have to override some "getRelationshipContainer()"
> method.
I think, you should move association to the different package on moving
one of the association ends (classes). To implement this behavior I suggest
to change “move” command for class to check corresponding condition and move
association if necessary. Currently EditHelpers are responsible for creation
of “move” command, so you can override getMoveCommand(MoveRequest req) method
in generated ClassEditHelper and return composite command moving associations
if necessary together with class.

-----------------
Alex Shatalin
Re: Retrieve semantic container for a relationship [message #34937 is a reply to message #34351] Wed, 30 August 2006 18:02 Go to previous messageGo to next message
Eclipse UserFriend
Hello Alex,

I tried to hook into the appropriate EditHelper, in particular into the
getMoveCommand(MoveRequest req) method. But it is just never called!

I even tried that on a totally different project (the simple library
example) - the same result.

I also studied the extensible type registry and the corresponding
tutorial after having read the thread
news://news.eclipse.org:119/ebeouf$njt$1@utils.eclipse.org

Can you provide me guidance on how to correctly register that EditHelper
and EditHelperAdvice classes?

Best regards,

Martin

Alex Shatalin wrote:
> Hello Martin,
>
>> Now, whenever I drag&drop some two classes that are connected via an
>> association edge onto a package compartment the classes are
>> semantically moved to that package but the assoc is not!
>> I would expect to have to override some "getRelationshipContainer()"
>> method.
> I think, you should move association to the different package on
> moving one of the association ends (classes). To implement this behavior
> I suggest to change “move” command for class to check corresponding
> condition and move association if necessary. Currently EditHelpers are
> responsible for creation of “move” command, so you can override
> getMoveCommand(MoveRequest req) method in generated ClassEditHelper and
> return composite command moving associations if necessary together with
> class.
>
> -----------------
> Alex Shatalin
>
>
Re: Retrieve semantic container for a relationship [message #35381 is a reply to message #34937] Thu, 31 August 2006 07:08 Go to previous message
Eclipse UserFriend
Hello Martin,

> I tried to hook into the appropriate EditHelper, in particular into
> the getMoveCommand(MoveRequest req) method. But it is just never
> called!
That’s really strange. Are you using generated code? Can you put a breakpoint
into AbstractEditHelper.getMoveCommand() and see if it is called while d&d
one diagram element to another?

> Can you provide me guidance on how to correctly register that
> EditHelper and EditHelperAdvice classes?
You can see EditHelper registration in generated plugin.xml, <metamodelType..>
tag.

-----------------
Alex Shatalin
Previous Topic:Getting eContainer in OCL expression
Next Topic:How to use Command/Request to delete the diagram itself?
Goto Forum:
  


Current Time: Sun Jul 06 09:21:32 EDT 2025

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

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

Back to the top