Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 10:15 Go to next message
Jin Missing name is currently offline Jin Missing nameFriend
Messages: 100
Registered: July 2009
Senior Member
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 07:35 Go to previous messageGo to next message
venkataramana m is currently offline venkataramana mFriend
Messages: 86
Registered: July 2009
Member
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 13:41 Go to previous message
Jin Missing name is currently offline Jin Missing nameFriend
Messages: 100
Registered: July 2009
Senior Member
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: Sat Apr 20 00:05:09 GMT 2024

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

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

Back to the top