Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Adding Existing Items During Creating (Create and Move)(Move and Create command)
Adding Existing Items During Creating (Create and Move) [message #644145] Thu, 09 December 2010 16:52
Erik Englund is currently offline Erik EnglundFriend
Messages: 49
Registered: July 2009
Member
In my diagram I have a NodeA that can be by itself or contained within NodeB.

I would like to be able to create a NodeB with the palette and click and drag a box around some existing NodeA's. And then during the creation process move those Nodes into NodeB.

Here is what I've tried:

In the diagram SematicEditPolicy override the GetCommand for CreateViewAndElementsRequest. Find the NodeA's that are within the target area and add them as a list to the request parameter map. And then at the end return a composite command of the super.getCommand(), which is usually null, and a delete View command for each NodeA that is going to be moved.

Also, I override the NodeB edit helper getConfigureCommand to return a MoveCommand to move the items from the root container into the sub container.

This seems to work. However, I am occasionally getting a NullPointer during the getOrphan request. It seems the GetParent is returning null. This may be unrelated.

So this method deletes the current View of NodeA so it also deletes any settings on that Node. I would have preferred to use the AddCommand, however, I can't return an add command until after the new view for NodeB is already created.

Thanks for all the help.
Previous Topic:How to create an image viewer integrated to GMF-based editors
Next Topic:Grab info from my domain file
Goto Forum:
  


Current Time: Wed Apr 24 19:57:20 GMT 2024

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

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

Back to the top