Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Creating multiple objects simultaneously
Creating multiple objects simultaneously [message #230931] Thu, 22 February 2007 21:06 Go to next message
Eclipse User
Originally posted by: mspivak.outerbay.com

I'm writing an app that's a bit different from typical GEF app. In
typical apps (or at least all examples I've seen) user picks a palette
tool, drops a node on the canvas, then picks a connection tool, and
connects the node with another one.

My needs are somewhat different:

1. User right clicks on a node that represents a db table and picks Add
Child from a popup menu.
2. A dialog is posted from which a user picks a valid child table
(validity is determined via some business rules)
3. Dismissing the dlg adds the child table to the diagram and connects
it to the parent from which the dialog was launched.


I got it working so far by making necessary updates to the model inside
the dialog's OK handler. The diagram updates itself when once model
sends out event notification that it changed.

The problem with the above approach is that it bypassed GEF's
EditPolicy/Request/Command infrastructure and I don't have a way to undo
the action. How would I use GEF properly in this case?

I think I need to move model updates to a command to allow for
undo/redo. But how do I create both a node and a connection via a single
request when CreateRequest and CreateConnectionRequest are separate?


Am I on the right track or is there a better way?

Thx,
Max
Re: Creating multiple objects simultaneously [message #231052 is a reply to message #230931] Mon, 26 February 2007 14:45 Go to previous message
Eclipse User
Originally posted by: sunil_kamath.nohotspammail.com

Max Spivak <mspivak@outerbay.com> wrote:
[snip]
>
> I think I need to move model updates to a command to allow for
> undo/redo. But how do I create both a node and a connection via a
> single request when CreateRequest and CreateConnectionRequest are
> separate?
>
Create your own Request/Command implementation.


--
Sunil
Previous Topic:Getting startet with GEF
Next Topic:3.3 Planned Changes?
Goto Forum:
  


Current Time: Thu Sep 18 03:49:00 GMT 2014

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

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