Skip to main content



      Home
Home » Eclipse Projects » GEF » How to do multiple editpart(models) creations in one creation time?
How to do multiple editpart(models) creations in one creation time? [message #206151] Sun, 25 December 2005 05:15 Go to next message
Eclipse UserFriend
Hi all:

How to do multiple editpart(models) creations in one creation time(that
is, a click in a toolentry of Palette)? In fact, I want to add two Nodes
and a link(between those nodes) in one click in palette. Is it possible
for gef? I'm exploring this problem ,but have not a clear idea. Who can
give me some advices?
Tnanks!

Jin
Re: How to do multiple editpart(models) creations in one creation time? [message #206168 is a reply to message #206151] Mon, 26 December 2005 02:35 Go to previous messageGo to next message
Eclipse UserFriend
All you should know is how the visuals get created in GEF...

1. Pick an entry in palette, click somewhere, then some editpolicy is requested for some command.

2. Command will update the model.

3. Model will notify listeners interested in model-change notifications.

4. Editparts acting as listeners decipher how model has been changed and appropriately create/update the visuals.

So in your case, if you want to add two nodes and a link between them ...

a) Your COMMAND in its execute method ... should create two node-models in some parent model...also the two node-models should be linked by a connection-model as usually. Thats it...Rest of editpart infrastructure which used to hold good for single node creation or connection creation will work as is..No need to change..All you need to remember is that for achieving for some composite task, your model change command should be a composite. You can achieve this by clubbing a set of primitive commands into a CompoundCommand also.

Thanks
~Venkat
Re: How to do multiple editpart(models) creations in one creation time? [message #206184 is a reply to message #206168] Mon, 26 December 2005 08:41 Go to previous message
Eclipse UserFriend
Venkataramana:

Thanks for your very detailed advices! I will try to do more tests:)

Jin
Previous Topic:add a moveable label to a conenction
Next Topic:shapes rcp : dependencies not resolved
Goto Forum:
  


Current Time: Sun May 11 04:03:25 EDT 2025

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

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

Back to the top