Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Multiple editparts - How to do it ?
Multiple editparts - How to do it ? [message #171691] Wed, 06 February 2008 14:58
Eclipse UserFriend
Originally posted by: vinsarwate.rediffmail.com

Hi,

In my application, there is a rectangle shape (RootEditPart) placed on
canvas. When user uses its connection handle, he/she is presented options
like "Level-1,"Level-2" etc in popup-menu.

When "Level-2" option is selected, two rectangle shapes (NodeEditPart)
should be drawn in such a way that RootEditPart is connected to one
NodeEditPart (say "First") and this "First" NodeEditPart should get
connected to "Second" NodeEditPart.

The current approach that we followed is, we created required model
structure in NodeEditHelper.getConfigureCommand(ConfigureRequest) in
following way -

1. Create model element (Node) using XXXFactory.eINSTANCE.createNode()
method.(This is for "Second" NodeEditPart).
2. Created SequenceEdge using XXXFactory.eINSTANCE.createSequenceEdit()
method.
3. Set target/source attribute of this SequenceEdge appropriately.
4. Added this SequenceEdge to outgoingConnection and incomingConnection
list of Node (from ConfigureRequest) and newly created Node respectively.
5. Added newly created Node and SequenceEdge to container.

The problem we are facing with this approach is, after completion of
operations, RootEditPart is connected to "First" NodeEditPart. And though
"Second" NodeEditPart does appear on canvas but "First" NodeEditPart is
not connected to this "Second" NodeEditPart. The model file shows they are
created correctly and when we reopen diagram again, connection between
"First" and "Second" NodeEditPart appears correctly.

Can anyone please point to that what is going wrong here or in case this
is not the correct way to achieve this then please provide us a correct
approach.

Thanks.
Vinay
Previous Topic:How to initate a diagram with something other than the canvas model element?
Next Topic:How to refresh title bar
Goto Forum:
  


Current Time: Fri Jul 18 00:34:07 EDT 2025

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

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

Back to the top