Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Retarget Actions
Retarget Actions [message #328383] Fri, 23 May 2008 15:25 Go to next message
Rahul Kamdar is currently offline Rahul KamdarFriend
Messages: 63
Registered: July 2009
Member
Hi,

I intend to retarget the cut/copy/paste/delete actions with my own actions
and implementations. I created my own custom Delete action extending
Retarget action. Then provided an implementation for its isEnabled() method
and finally setGlobalActionHandler (for actionBars for the View Site -
Project Explorer View) with arguments (ActionFactory.DELETE.getId(),
deleteAction) where deleteAction is my custom action. However, this doesn't
tie the Edit > Delete to my action. Also, in the right-click menu where I
have contributed my Delete action through an actionProvider has two delete
actions displayed (its not overriding the default delete). Delete key on
keyboard also triggers the default action.

I tried referring to Micheal's article at
http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-_115067357450703178.html
for this and followed most of the guidelines given but still am unable to
retarget the actions as required.

Can someone help me in this or guide me to the appropriate material for
retarget actions? I can post parts from my code if needed.

I had originally posted this on platform.swt group... also I am using
Eclipse 3.2, so handlers and commands mechanism which is in 3.3 won't be
available to me, right?

Any help would be highly appreciated.

Thanks,
Rahul
Re: Retarget Actions [message #328399 is a reply to message #328383] Fri, 23 May 2008 22:23 Go to previous messageGo to next message
David Kyle is currently offline David KyleFriend
Messages: 125
Registered: July 2009
Senior Member
Rahul,

Commands and handlers are available in 3.2. I would recommend that you use
them. We built our own project explorer based on Mike's common navigator
framework. We're very happy we used his framework.

We use a mix of command/handlers and old fashion actions. The core
copy/paste/delete are implemented as actions. Other plugins use
command/handles to contribute to our project explorer.

My delete action extends Action, not RetargetAction. I don't remember having
any problems with it. A quick test shows I can select a file and delete it
using the keybinding, context menu and Edit -> Delete pulldown menu.

David Kyle
http://richclientplatform.blogspot.com/
Re: Retarget Actions [message #328402 is a reply to message #328399] Fri, 23 May 2008 22:58 Go to previous messageGo to next message
David Kyle is currently offline David KyleFriend
Messages: 125
Registered: July 2009
Senior Member
Rahul,

I lied. Command/Handlers/org.eclipse.ui.menus are not fully implemented in
3.2. Is there a reason you can't migrated forward to 3.3? We made the move
without any problems.

Anyways, my comments about our delete action should be correct with 3.2.

David Kyle
http://richclientplatform.blogspot.com/
Re: Retarget Actions [message #328417 is a reply to message #328402] Sat, 24 May 2008 09:38 Go to previous messageGo to next message
Rahul Kamdar is currently offline Rahul KamdarFriend
Messages: 63
Registered: July 2009
Member
Hi David,

Thanks a lot for the help! I can't move to 3.3, its a limitation that can't
be overcome :)

From your comments, does it mean that I can use commands and handlers to
retarget Delete even in 3.2? Writing my custom delete action that extends
simply Action and using commands, bindings and handlers I can retarget
completely the delete action in 3.2?

Thanks,
Rahul

"David Kyle" <davidk@kelman.com> wrote in message
news:g17i0s$9up$1@build.eclipse.org...
> Rahul,
>
> I lied. Command/Handlers/org.eclipse.ui.menus are not fully implemented in
> 3.2. Is there a reason you can't migrated forward to 3.3? We made the move
> without any problems.
>
> Anyways, my comments about our delete action should be correct with 3.2.
>
> David Kyle
> http://richclientplatform.blogspot.com/
>
Re: Retarget Actions [message #328608 is a reply to message #328417] Wed, 28 May 2008 13:15 Go to previous message
Rahul Kamdar is currently offline Rahul KamdarFriend
Messages: 63
Registered: July 2009
Member
Thanks David, the problem is now resolved. I was given some suggestions
elsewhere and it seems to have solved the issue!

Thanks a bunch for your help and guidance!

Rahul

"Rahul Kamdar" <rtkamdar@kamdars-india.com> wrote in message
news:g18nnf$91v$1@build.eclipse.org...
> Hi David,
>
> Thanks a lot for the help! I can't move to 3.3, its a limitation that
> can't be overcome :)
>
> From your comments, does it mean that I can use commands and handlers to
> retarget Delete even in 3.2? Writing my custom delete action that extends
> simply Action and using commands, bindings and handlers I can retarget
> completely the delete action in 3.2?
>
> Thanks,
> Rahul
>
> "David Kyle" <davidk@kelman.com> wrote in message
> news:g17i0s$9up$1@build.eclipse.org...
>> Rahul,
>>
>> I lied. Command/Handlers/org.eclipse.ui.menus are not fully implemented
>> in 3.2. Is there a reason you can't migrated forward to 3.3? We made the
>> move without any problems.
>>
>> Anyways, my comments about our delete action should be correct with 3.2.
>>
>> David Kyle
>> http://richclientplatform.blogspot.com/
>>
>
>
Previous Topic:Debug or Run
Next Topic:[Databinding] Problem with MasterDetail and EObjectObservableMap
Goto Forum:
  


Current Time: Wed Jan 15 10:12:31 GMT 2025

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

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

Back to the top