|
|
Re: How to participate in cut / copy / paste? [message #331257 is a reply to message #331236] |
Thu, 28 August 2008 15:30 |
Eclipse User |
|
|
|
Originally posted by: mario.winterer.gmx.net
Hi!
I think since eclipse 3.4 it should also be possible to use the command
framework and register a command handler for the required retargetable
action.
But I'm wondering what happens if both, an action delegate and a command
handler are registered for a given command/action id. What happens if
the command is executed? Will the handler be used or the action delegate?
Mario
Paul Webster schrieb:
> kaprasanna wrote:
>> Hi,
>>
>> I want the cut / copy / paste buttons on the toolbar (and the Edit
>> menu options) to be enabled when user selects a view of my plugin. And
>> I want to perform some actions when the respective button is pressed.
>> How can I achieve this?
>
> Check out the help listed in my sig and
> http://www.eclipse.org/articles/Article-action-contribution/ Contributing%20Actions%20to%20the%20Eclipse%20Workbench.html
>
>
> PW
>
>
|
|
|
|
Re: How to participate in cut / copy / paste? [message #331300 is a reply to message #331276] |
Fri, 29 August 2008 10:29 |
Eclipse User |
|
|
|
Originally posted by: mario.winterer.gmx.net
Ah. Nice. I thought this is only possible using the extension point.
But in my case, a global action handler is already registered for the
copy action. Now I want to additionally register a handler for the same
copy action.
But unfortunately, the global action handler is chosen always, my
handler never gets executed.
Paul Webster schrieb:
> Mario Winterer wrote:
>> Hi!
>>
>> I think since eclipse 3.4 it should also be possible to use the
>> command framework and register a command handler for the required
>> retargetable action.
>> But I'm wondering what happens if both, an action delegate and a
>> command handler are registered for a given command/action id. What
>> happens if the command is executed? Will the handler be used or the
>> action delegate?
>
> In 3.4 you can do it entirely using commands and handlers. For example,
> when your view is created simply get the IHandlerService and register
> handlers:
>
> IHandlerService hs
> = (IHandlerService) getSite().getService(IHandlerService.class);
> hs.activeHandler("org.eclipse.ui.edit.copy", new MyCopyHandler());
> // and so forth for cut and paste
>
> PW
>
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03921 seconds