Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Invoking A Command
Invoking A Command [message #191065] Mon, 08 August 2005 18:42 Go to next message
Josh Reed is currently offline Josh ReedFriend
Messages: 38
Registered: July 2009
Member
Hello,

As per Randy's suggestion a few weeks back, I've been converting my
direct model changes in my properties view to using GEF Commands. I've
created a new request type, an edit policy to handle the requests, and
commands to perform all the model changes. My only problem is how do I
inject the Request such that the edit policies handle it. I found
EditPart.performRequest(Request), but I'd much rather just install the
edit policy I've written instead of implementing the request handling
logic in the performRequest method of every edit part it affected. Is
there a way to do this?

Thanks,
Josh Reed
Re: Invoking A Command [message #191079 is a reply to message #191065] Mon, 08 August 2005 19:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Josh Reed" <jareed@iastate.edu> wrote in message
news:dd8927$ceg$1@news.eclipse.org...
> Hello,
>
> As per Randy's suggestion a few weeks back, I've been converting my direct
> model changes in my properties view to using GEF Commands. I've

You don't have to use requests and editpolicies in order to use commands.
For example, GEF's PropertySheetEntry implementation just calls directly to
the IPropertySource and makes changes.

> created a new request type, an edit policy to handle the requests, and
> commands to perform all the model changes. My only problem is how do I
> inject the Request such that the edit policies handle it. I found
> EditPart.performRequest(Request), but I'd much rather just install the
> edit policy I've written instead of implementing the request handling
> logic in the performRequest method of every edit part it affected. Is
> there a way to do this?

There is a bugzilla requesting that performRequest be forwarded to the
editpolicy interface. We have not made this change yet. You could use
getCommand instead perhaps.
>
> Thanks,
> Josh Reed
Re: Invoking A Command [message #191128 is a reply to message #191079] Mon, 08 August 2005 21:00 Go to previous messageGo to next message
Josh Reed is currently offline Josh ReedFriend
Messages: 38
Registered: July 2009
Member
I think what I am looking for is CommandStack.execute(Command). This
should allow me to change the model in a GEF sort of way and gain the
benefits of undo/redo, etc.

Thanks,
Josh

Randy Hudson wrote:
> "Josh Reed" <jareed@iastate.edu> wrote in message
> news:dd8927$ceg$1@news.eclipse.org...
>
>>Hello,
>>
>>As per Randy's suggestion a few weeks back, I've been converting my direct
>>model changes in my properties view to using GEF Commands. I've
>
>
> You don't have to use requests and editpolicies in order to use commands.
> For example, GEF's PropertySheetEntry implementation just calls directly to
> the IPropertySource and makes changes.
>
>
>>created a new request type, an edit policy to handle the requests, and
>>commands to perform all the model changes. My only problem is how do I
>>inject the Request such that the edit policies handle it. I found
>>EditPart.performRequest(Request), but I'd much rather just install the
>>edit policy I've written instead of implementing the request handling
>>logic in the performRequest method of every edit part it affected. Is
>>there a way to do this?
>
>
> There is a bugzilla requesting that performRequest be forwarded to the
> editpolicy interface. We have not made this change yet. You could use
> getCommand instead perhaps.
>
>>Thanks,
>>Josh Reed
>
>
>
Re: Invoking A Command [message #191257 is a reply to message #191128] Tue, 09 August 2005 17:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tankun.web.de

do u have realizd the undo/redo function?by this way?
Re: Invoking A Command [message #191263 is a reply to message #191257] Tue, 09 August 2005 19:03 Go to previous message
Josh Reed is currently offline Josh ReedFriend
Messages: 38
Registered: July 2009
Member
tan kun wrote:
> do u have realizd the undo/redo function?by this way?
>

The undo/redo should work since I am using GEF Commands. I haven't
hooked up the undo action yet, so I haven't tested it.

Josh
Previous Topic:examples of right-click on an EditPart to create child objects
Next Topic:SWT to Image
Goto Forum:
  


Current Time: Tue Dec 03 08:50:24 GMT 2024

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

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

Back to the top