EditPart Creation question [message #217609] |
Thu, 08 June 2006 15:18 |
David Michonneau Messages: 1145 Registered: July 2009 |
Senior Member |
|
|
Hi,
We have a GEF editor with a palette, and when we drag an item from the
palette to the GEF editor, we want to display a builder for the item. For
that builder to work correctly, it needs its model to be hooked in the main
model (to access inherited properties), so that means we need to create and
attach the element to the main model before the builder is opened. If the
user clicks on OK, then we want to commit the creation, if the user clicks
cancel, we want to roll it back. Now our problem is that we use the
performDirectEdit to open the builder, but at that time, everything is
already committed on the command stack, so clicking on cancel leaves the
element in the main model, which is not the right behavior.
What is the solution?
Thanks,
David Michonneau
BIRT Committer
|
|
|
Re: EditPart Creation question [message #217656 is a reply to message #217609] |
Mon, 12 June 2006 01:21 |
Steven R. Shaw Messages: 128 Registered: July 2009 |
Senior Member |
|
|
Typically, you would want to put up UI in response to a request and then
based on the parameters of the UI, execute a command on the model. So, in
your case, the RequestConstants.REQ_DIRECT_EDIT would be the request type
you would trigger on. The access point would be in the performRequest
(Request request) or in a custom EditPolicy you've defined.
-Steve
"David Michonneau" <dmichonneau@actuate.com> wrote in message
news:e69f4e$9h3$1@utils.eclipse.org...
> Hi,
>
> We have a GEF editor with a palette, and when we drag an item from the
> palette to the GEF editor, we want to display a builder for the item. For
> that builder to work correctly, it needs its model to be hooked in the
main
> model (to access inherited properties), so that means we need to create
and
> attach the element to the main model before the builder is opened. If the
> user clicks on OK, then we want to commit the creation, if the user clicks
> cancel, we want to roll it back. Now our problem is that we use the
> performDirectEdit to open the builder, but at that time, everything is
> already committed on the command stack, so clicking on cancel leaves the
> element in the main model, which is not the right behavior.
>
> What is the solution?
>
> Thanks,
>
> David Michonneau
> BIRT Committer
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03020 seconds