Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » EditPart Creation question
EditPart Creation question [message #217609] Thu, 08 June 2006 15:18 Go to next message
David Michonneau is currently offline David MichonneauFriend
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 Go to previous message
Steven R. Shaw is currently offline Steven R. ShawFriend
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
>
>
Previous Topic:html tooltip in draw2d
Next Topic:Synchronization Problem when moving BendPoints
Goto Forum:
  


Current Time: Fri Apr 19 11:44:19 GMT 2024

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

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

Back to the top