Key bindings: what to use instead of getKeyBindingService().registerAction(action)? [message #214995] |
Tue, 25 April 2006 15:56 |
Eclipse User |
|
|
|
Originally posted by: p.beauvoir.bolton.ac.uk
Hi,
I'm developing a GEF Editor based on the example Flow Editor and I need
to register the Zoom Action's key binding in the Editor thus:
getSite().getKeyBindingService().registerAction(zoomIn);
This works but is deprecated. How does one achieve the same thing (i.e.
register a key binding for an action) but in a non-deprecated way?
Many thanks.
PB
|
|
|
Re: Key bindings: what to use instead of getKeyBindingService().registerAction(action)? [message #214999 is a reply to message #214995] |
Tue, 25 April 2006 17:10 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
Phillip Beauvoir <p.beauvoir@bolton.ac.uk> wrote:
> Hi,
>
> I'm developing a GEF Editor based on the example Flow Editor and I
> need to register the Zoom Action's key binding in the Editor thus:
>
> getSite().getKeyBindingService().registerAction(zoomIn);
>
> This works but is deprecated. How does one achieve the same thing
> (i.e. register a key binding for an action) but in a non-deprecated
> way?
> Many thanks.
>
> PB
((IHandlerService)getSite().getHandlerService()).activateHan dler(zoomIn.getActionDefinitionId(),new
ActionHandler(zoomIn));
(or something like that)
--
Sunil
|
|
|
Re: Key bindings: what to use instead of getKeyBindingService().registerAction(action)? [message #215004 is a reply to message #214999] |
Tue, 25 April 2006 17:28 |
Eclipse User |
|
|
|
Originally posted by: p.beauvoir.bolton.ac.uk
Sunil Kamath wrote:
> Phillip Beauvoir <p.beauvoir@bolton.ac.uk> wrote:
>> Hi,
>>
>> I'm developing a GEF Editor based on the example Flow Editor and I
>> need to register the Zoom Action's key binding in the Editor thus:
>>
>> getSite().getKeyBindingService().registerAction(zoomIn);
>>
>> This works but is deprecated. How does one achieve the same thing
>> (i.e. register a key binding for an action) but in a non-deprecated
>> way?
>> Many thanks.
>>
>> PB
>
> ((IHandlerService)getSite().getHandlerService()).activateHan dler(zoomIn.getActionDefinitionId(),new
> ActionHandler(zoomIn));
>
> (or something like that)
>
Thanks very much for that, it worked!
The code I used is this:
IHandlerService service =
(IHandlerService)getEditorSite().getService(IHandlerService. class);
service.activateHandler(zoomIn.getActionDefinitionId(),
new ActionHandler(zoomIn));
service.activateHandler(zoomOut.getActionDefinitionId(),
new ActionHandler(zoomOut));
PB
|
|
|
Re: Key bindings: what to use instead of getKeyBindingService().registerAction(action)? [message #215008 is a reply to message #215004] |
Tue, 25 April 2006 17:34 |
Eclipse User |
|
|
|
Originally posted by: p.beauvoir.bolton.ac.uk
Phillip Beauvoir wrote:
> Sunil Kamath wrote:
>> Phillip Beauvoir <p.beauvoir@bolton.ac.uk> wrote:
>>> Hi,
>>>
>>> I'm developing a GEF Editor based on the example Flow Editor and I
>>> need to register the Zoom Action's key binding in the Editor thus:
>>>
>>> getSite().getKeyBindingService().registerAction(zoomIn);
>>>
>>> This works but is deprecated. How does one achieve the same thing
>>> (i.e. register a key binding for an action) but in a non-deprecated
>>> way?
>>> Many thanks.
>>>
>>> PB
>>
>> ((IHandlerService)getSite().getHandlerService()).activateHan dler(zoomIn.getActionDefinitionId(),new
>> ActionHandler(zoomIn));
>>
>> (or something like that)
>>
>
> Thanks very much for that, it worked!
>
> The code I used is this:
>
> IHandlerService service =
> (IHandlerService)getEditorSite().getService(IHandlerService. class);
>
> service.activateHandler(zoomIn.getActionDefinitionId(),
> new ActionHandler(zoomIn));
>
> service.activateHandler(zoomOut.getActionDefinitionId(),
> new ActionHandler(zoomOut));
>
> PB
Do I have to deactiviate the handlers when the Edit part is closed?
PB
|
|
|
Re: Key bindings: what to use instead of getKeyBindingService().registerAction(action)? [message #215086 is a reply to message #215008] |
Wed, 26 April 2006 14:05 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
No, services that are provided by your site get disposed when the site is
disposed.
"Phillip Beauvoir" <p.beauvoir@bolton.ac.uk> wrote in message
news:e2lmi2$tsp$1@utils.eclipse.org...
> Phillip Beauvoir wrote:
>> Sunil Kamath wrote:
>>> Phillip Beauvoir <p.beauvoir@bolton.ac.uk> wrote:
>>>> Hi,
>>>>
>>>> I'm developing a GEF Editor based on the example Flow Editor and I
>>>> need to register the Zoom Action's key binding in the Editor thus:
>>>>
>>>> getSite().getKeyBindingService().registerAction(zoomIn);
>>>>
>>>> This works but is deprecated. How does one achieve the same thing
>>>> (i.e. register a key binding for an action) but in a non-deprecated
>>>> way?
>>>> Many thanks.
>>>>
>>>> PB
>>>
>>> ((IHandlerService)getSite().getHandlerService()).activateHan dler(zoomIn.getActionDefinitionId(),new
>>> ActionHandler(zoomIn));
>>>
>>> (or something like that)
>>>
>>
>> Thanks very much for that, it worked!
>>
>> The code I used is this:
>>
>> IHandlerService service =
>> (IHandlerService)getEditorSite().getService(IHandlerService. class);
>>
>> service.activateHandler(zoomIn.getActionDefinitionId(),
>> new ActionHandler(zoomIn));
>>
>> service.activateHandler(zoomOut.getActionDefinitionId(),
>> new ActionHandler(zoomOut));
>>
>> PB
>
>
> Do I have to deactiviate the handlers when the Edit part is closed?
>
> PB
|
|
|
Re: Key bindings: what to use instead of getKeyBindingService().registerAction(action)? [message #215117 is a reply to message #215086] |
Wed, 26 April 2006 22:02 |
Eclipse User |
|
|
|
Originally posted by: p.beauvoir.bolton.ac.uk
Randy Hudson wrote:
> No, services that are provided by your site get disposed when the site is
> disposed.
>
> "Phillip Beauvoir" <p.beauvoir@bolton.ac.uk> wrote in message
> news:e2lmi2$tsp$1@utils.eclipse.org...
>> Phillip Beauvoir wrote:
>>> Sunil Kamath wrote:
>>>> Phillip Beauvoir <p.beauvoir@bolton.ac.uk> wrote:
>>>>> Hi,
>>>>>
>>>>> I'm developing a GEF Editor based on the example Flow Editor and I
>>>>> need to register the Zoom Action's key binding in the Editor thus:
>>>>>
>>>>> getSite().getKeyBindingService().registerAction(zoomIn);
>>>>>
>>>>> This works but is deprecated. How does one achieve the same thing
>>>>> (i.e. register a key binding for an action) but in a non-deprecated
>>>>> way?
>>>>> Many thanks.
>>>>>
>>>>> PB
>>>> ((IHandlerService)getSite().getHandlerService()).activateHan dler(zoomIn.getActionDefinitionId(),new
>>>> ActionHandler(zoomIn));
>>>>
>>>> (or something like that)
>>>>
>>> Thanks very much for that, it worked!
>>>
>>> The code I used is this:
>>>
>>> IHandlerService service =
>>> (IHandlerService)getEditorSite().getService(IHandlerService. class);
>>>
>>> service.activateHandler(zoomIn.getActionDefinitionId(),
>>> new ActionHandler(zoomIn));
>>>
>>> service.activateHandler(zoomOut.getActionDefinitionId(),
>>> new ActionHandler(zoomOut));
>>>
>>> PB
>>
>> Do I have to deactiviate the handlers when the Edit part is closed?
>>
>> PB
>
>
Thanks Randy. All is cool now :)
PB
|
|
|
|
Powered by
FUDForum. Page generated in 0.02600 seconds