Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Convert accelerator to KeyStroke?
Convert accelerator to KeyStroke? [message #203285] Mon, 21 November 2005 16:00 Go to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
I am using several retarget actions. I am setting the commandId/definitionId
on them, and their accelerators show properly in the context menu. But I
still need to set the
accelerator in the KeyHandler in order for the keys to actually trigger an
action. Is this supposed
to work automatically or should I get the accelerator from the action and
put the appropriate KeyStroke with the action into the KeyHandler? In the
latter case, is there a simple way to convert the accelerator into a
KeyStroke?
Re: Convert accelerator to KeyStroke? [message #203315 is a reply to message #203285] Mon, 21 November 2005 17:06 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dlsqvh$iut$1@news.eclipse.org...
>I am using several retarget actions. I am setting the
>commandId/definitionId on them, and their accelerators show properly in the
>context menu. But I still need to set the
> accelerator in the KeyHandler in order for the keys to actually trigger an
> action. Is this supposed
> to work automatically or should I get the accelerator from the action and
> put the appropriate KeyStroke with the action into the KeyHandler? In the
> latter case, is there a simple way to convert the accelerator into a
> KeyStroke?
>

Let me clarify this a little. For several actions, the accelerators work
fine, and I don't have to tell the KeyHandler about them (undo, redo,
delete). But for selectAll and some others I have to put into the KeyHandler
with a KeyStroke, which means that the accelerator is hardcoded. So I am not
sure if I am missing something with the action or if I need convert the
accelerator into a KeyStroke.
Re: Convert accelerator to KeyStroke? [message #203337 is a reply to message #203315] Mon, 21 November 2005 18:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

SelectAll works fine in the logic example. Are you declaring it as a global
action key in the ActionBarContributor?

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dlsurc$ooa$1@news.eclipse.org...
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:dlsqvh$iut$1@news.eclipse.org...
> >I am using several retarget actions. I am setting the
> >commandId/definitionId on them, and their accelerators show properly in
the
> >context menu. But I still need to set the
> > accelerator in the KeyHandler in order for the keys to actually trigger
an
> > action. Is this supposed
> > to work automatically or should I get the accelerator from the action
and
> > put the appropriate KeyStroke with the action into the KeyHandler? In
the
> > latter case, is there a simple way to convert the accelerator into a
> > KeyStroke?
> >
>
> Let me clarify this a little. For several actions, the accelerators work
> fine, and I don't have to tell the KeyHandler about them (undo, redo,
> delete). But for selectAll and some others I have to put into the
KeyHandler
> with a KeyStroke, which means that the accelerator is hardcoded. So I am
not
> sure if I am missing something with the action or if I need convert the
> accelerator into a KeyStroke.
>
>
Re: Convert accelerator to KeyStroke? [message #203417 is a reply to message #203337] Mon, 21 November 2005 23:45 Go to previous message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Thanks, with that I got selectAll to work.

Then I did the same thing for 'Open' and 'Open Type Hierarchy', but F3 and
F4 don't work. I created RetargetActions with ids JdtActionConstants.OPEN
and JdtActionConstants.OPEN_TYPE_HIERARCHY, and I set the definitionIds to
IJavaEditorActionDefinitionIds.OPEN_EDITOR and
IJavaEditorActionDefinitionIds.OPEN_TYPE_HIERARCHY on my actions. So
basically I did the same thing as with selectAll, but it doesn't work.

"Pratik Shah" <none@unknown.com> wrote in message
news:dlt5dr$36l$1@news.eclipse.org...
> SelectAll works fine in the logic example. Are you declaring it as a
> global
> action key in the ActionBarContributor?
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:dlsurc$ooa$1@news.eclipse.org...
>> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
>> news:dlsqvh$iut$1@news.eclipse.org...
>> >I am using several retarget actions. I am setting the
>> >commandId/definitionId on them, and their accelerators show properly in
> the
>> >context menu. But I still need to set the
>> > accelerator in the KeyHandler in order for the keys to actually trigger
> an
>> > action. Is this supposed
>> > to work automatically or should I get the accelerator from the action
> and
>> > put the appropriate KeyStroke with the action into the KeyHandler? In
> the
>> > latter case, is there a simple way to convert the accelerator into a
>> > KeyStroke?
>> >
>>
>> Let me clarify this a little. For several actions, the accelerators work
>> fine, and I don't have to tell the KeyHandler about them (undo, redo,
>> delete). But for selectAll and some others I have to put into the
> KeyHandler
>> with a KeyStroke, which means that the accelerator is hardcoded. So I am
> not
>> sure if I am missing something with the action or if I need convert the
>> accelerator into a KeyStroke.
>>
>>
>
>
Previous Topic:How can I do an editable Text inside Shape?
Next Topic:selection of multiple nodes
Goto Forum:
  


Current Time: Fri Sep 20 14:56:09 GMT 2024

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

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

Back to the top