Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Dedicated behavior at link creation
Dedicated behavior at link creation [message #230286] Thu, 14 May 2009 15:20 Go to next message
Mechali is currently offline MechaliFriend
Messages: 9
Registered: July 2009
Junior Member
Hello,
sorry to borrow your help again but I am bit lost with GMF. I have been
searching for the last hours how to implement a dedicated behavior in the
diagram editor:
On my Diagram i can connect a "type A" and a "type B" element with a "Data
link". I would like to allow the user to connect a "type A container" with
a "type B". Then, at creation time, a Dialog window would display and let
the user create a new "Type A" element into the container he has selected.
This would result in changing the source of link and creating this new
element.

So here are my questions:
- Is it possible to implement such a behavior with GMF?
- If it is, where should I look at?
- How could I create both "Type A" EditPart and model when I know only the
EObject container?
- Should I place my code directly into getCreateRelationshipCommand of the
BaseItemSemanticEditPolicy (even if I may also create nodes)?
- Where is actually instanciated the relationship creation command?

Thank you in advance,
R. Mechali


Note : I have tried the following changes
- Use the EditHelper to provide a custom IEditHelperAdvice: I cannot
acces the FlowData created because configureRequest is called before
getBeforeEditCommand(...).execute(). This implies I cannot open a
DialogWindow on creation.
- Modify "getCreateRelationshipCommand(CreateRelationShipRequest)" to
provide my own command to create the link, it is created two times (the
initial command is still executed !)
- Change the Data link creation command : Even if the method canExecute()
returns true, the feed back shows an invalid action icon and nothing
happens.
Re: Dedicated behavior at link creation [message #230422 is a reply to message #230286] Fri, 15 May 2009 09:37 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Mechali,

> - Is it possible to implement such a behavior with GMF?
Yes, i think so, but you have to be ready for manually coding this functionality.

> - If it is, where should I look at?
I think you have to review link creation process in GMf and create manually
one more link displaying this dialog at creation time + creating a node together
with link.

> - How could I create both "Type A" EditPart and model when I know only
> the EObject container?
You don't need to create EditParts - you have to create domain model elements
+ notation model elements representing corresponding domain model elements
on a diagram (if necessary).

> - Should I place my code directly into getCreateRelationshipCommand of
> the BaseItemSemanticEditPolicy (even if I may also create nodes)?
I think you should place your code into getCreateRelationshipCommand of XXXItemSemanticEditPolicies
attached to link source/target EditParts - just like it is done with the
rest of the links.

> - Where is actually instanciated the relationship creation command?
In corresponding EditPolicy. Notation model elements will be created by command
produced in GraphicalNodeEditPolicy, domain model strucutre - by XXXItemSemanticEditPolicies.
I suggest you debugging simple link creation process to get an overview of
this process and then create your own link manually.

-----------------
Alex Shatalin
Re: Dedicated behavior at link creation [message #230462 is a reply to message #230422] Fri, 15 May 2009 12:22 Go to previous message
Mechali is currently offline MechaliFriend
Messages: 9
Registered: July 2009
Junior Member
Thx again Alex,
I'll have a look on this as soon as possible. If I find my way out, i ll
post it around. Thx again!

R. Mechali
Previous Topic:How to get Shortcut from a existing GMF editor not providing shortcut?
Next Topic:Derived feature as containment feature
Goto Forum:
  


Current Time: Tue Apr 23 05:32:55 GMT 2024

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

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

Back to the top