Skip to main content



      Home
Home » Eclipse Projects » GEF » Problems in getting hotkeys to work
Problems in getting hotkeys to work [message #87195] Mon, 14 July 2003 17:55 Go to next message
Eclipse UserFriend
Originally posted by: soroker.us.ibm.com

I'm unable to get hotkeys (e.g. CTRL-Z for Undo) to work in my graphical
editor.
I tried to mimic the code from the Logic example, but no luck there.
I tried to force it with:

_sharedKeyHandler.put(
KeyStroke.getPressed('z', SWT.CTRL),
getActionRegistry().getAction(GEFActionConstants.UNDO));

but no luck there too...
The hotkeys *are* active in the outline editor, but not in the graphical
editor.

The editor is embedded in a MultiPageEditorPart.

Any tips would be appreciated.

Thanks, Danny Soroker.
Re: Problems in getting hotkeys to work [message #87224 is a reply to message #87195] Mon, 14 July 2003 19:41 Go to previous messageGo to next message
Eclipse UserFriend
I believe this is taken care of in LogicActionBarContributor.buildActions()
which calls addRetargetAction(new UndoRetargetAction()) which adds the action's
id to the global action list. Then in setActiveEditor(), the global action ids
get registered as global actions.

Eric


Danny Soroker wrote:
> I'm unable to get hotkeys (e.g. CTRL-Z for Undo) to work in my graphical
> editor.
> I tried to mimic the code from the Logic example, but no luck there.
> I tried to force it with:
>
> _sharedKeyHandler.put(
> KeyStroke.getPressed('z', SWT.CTRL),
> getActionRegistry().getAction(GEFActionConstants.UNDO));
>
> but no luck there too...
> The hotkeys *are* active in the outline editor, but not in the graphical
> editor.
>
> The editor is embedded in a MultiPageEditorPart.
>
> Any tips would be appreciated.
>
> Thanks, Danny Soroker.
>
>
>
Re: Problems in getting hotkeys to work [message #87239 is a reply to message #87224] Tue, 15 July 2003 10:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: soroker.us.ibm.com

Eric,

The actions are enabled (I can Undo via the context menu
or via the main menu (edit->undo), but not via the keyboard..
Where, specifically, do the keys actions / events get enabled for
the graphical editor?

Thanks, Danny.

"Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
news:bevf2f$5qf$1@eclipse.org...
> I believe this is taken care of in
LogicActionBarContributor.buildActions()
> which calls addRetargetAction(new UndoRetargetAction()) which adds the
action's
> id to the global action list. Then in setActiveEditor(), the global
action ids
> get registered as global actions.
>
> Eric
>
>
> Danny Soroker wrote:
> > I'm unable to get hotkeys (e.g. CTRL-Z for Undo) to work in my graphical
> > editor.
> > I tried to mimic the code from the Logic example, but no luck there.
> > I tried to force it with:
> >
> > _sharedKeyHandler.put(
> > KeyStroke.getPressed('z', SWT.CTRL),
> > getActionRegistry().getAction(GEFActionConstants.UNDO));
> >
> > but no luck there too...
> > The hotkeys *are* active in the outline editor, but not in the graphical
> > editor.
> >
> > The editor is embedded in a MultiPageEditorPart.
> >
> > Any tips would be appreciated.
> >
> > Thanks, Danny Soroker.
> >
> >
> >
>
Re: Problems in getting hotkeys to work [message #87266 is a reply to message #87239] Tue, 15 July 2003 10:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The Eclipse workbench defines a global action for Undo. It appears in the
menubar, and steals CTRL+Z from every control in the Shell. This is the
reason that the keystroke is stolen from your viewer.

To get undo to be associated with the keystroke, you must register your
action handler for undo with the workbench, which is part of what Eric
described.

"Danny Soroker" <soroker@us.ibm.com> wrote in message
news:bf12r1$pb4$1@eclipse.org...
> Eric,
>
> The actions are enabled (I can Undo via the context menu
> or via the main menu (edit->undo), but not via the keyboard..
> Where, specifically, do the keys actions / events get enabled for
> the graphical editor?
>
> Thanks, Danny.
>
> "Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
> news:bevf2f$5qf$1@eclipse.org...
> > I believe this is taken care of in
> LogicActionBarContributor.buildActions()
> > which calls addRetargetAction(new UndoRetargetAction()) which adds the
> action's
> > id to the global action list. Then in setActiveEditor(), the global
> action ids
> > get registered as global actions.
> >
> > Eric
> >
> >
> > Danny Soroker wrote:
> > > I'm unable to get hotkeys (e.g. CTRL-Z for Undo) to work in my
graphical
> > > editor.
> > > I tried to mimic the code from the Logic example, but no luck there.
> > > I tried to force it with:
> > >
> > > _sharedKeyHandler.put(
> > > KeyStroke.getPressed('z', SWT.CTRL),
> > > getActionRegistry().getAction(GEFActionConstants.UNDO));
> > >
> > > but no luck there too...
> > > The hotkeys *are* active in the outline editor, but not in the
graphical
> > > editor.
> > >
> > > The editor is embedded in a MultiPageEditorPart.
> > >
> > > Any tips would be appreciated.
> > >
> > > Thanks, Danny Soroker.
> > >
> > >
> > >
> >
>
>
Re: Problems in getting hotkeys to work [message #87300 is a reply to message #87266] Tue, 15 July 2003 11:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: soroker.us.ibm.com

Randy,

My code contains all the calls that Eric mentioned, but still
the CTRL+SO is not responding. Given what you say, I am
guessing that I am doing the registration, but it is, somehow, overridden.
Maybe this has to do with it being embedded in a Multiage editor.
Does that sound right to you?

What is the specific call that registers my action handler for undo
with the workbench?


Thanks, Danny.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bf13ac$psm$1@eclipse.org...
> The Eclipse workbench defines a global action for Undo. It appears in the
> menubar, and steals CTRL+Z from every control in the Shell. This is the
> reason that the keystroke is stolen from your viewer.
>
> To get undo to be associated with the keystroke, you must register your
> action handler for undo with the workbench, which is part of what Eric
> described.
>
>
Re: Problems in getting hotkeys to work [message #87313 is a reply to message #87300] Tue, 15 July 2003 11:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: soroker.us.ibm.com

....should be CTRL+Z below (always use the spell-checker with caution...)
BTW, the actions are also active in the Action Bar, and also as hotkeys
in the outline viewer.

Danny.

"Danny Soroker" <soroker@us.ibm.com> wrote in message
news:bf15d3$shr$1@eclipse.org...
> Randy,
>
> My code contains all the calls that Eric mentioned, but still
> the CTRL+SO is not responding. Given what you say, I am
> guessing that I am doing the registration, but it is, somehow, overridden.
> Maybe this has to do with it being embedded in a Multiage editor.
> Does that sound right to you?
>
> What is the specific call that registers my action handler for undo
> with the workbench?
>
>
> Thanks, Danny.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:bf13ac$psm$1@eclipse.org...
> > The Eclipse workbench defines a global action for Undo. It appears in
the
> > menubar, and steals CTRL+Z from every control in the Shell. This is the
> > reason that the keystroke is stolen from your viewer.
> >
> > To get undo to be associated with the keystroke, you must register your
> > action handler for undo with the workbench, which is part of what Eric
> > described.
> >
> >
>
>
>
Re: Problems in getting hotkeys to work [message #87343 is a reply to message #87300] Tue, 15 July 2003 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Danny Soroker" <soroker@us.ibm.com> wrote in message
news:bf15d3$shr$1@eclipse.org...
> Randy,
>
> My code contains all the calls that Eric mentioned, but still
> the CTRL+SO is not responding. Given what you say, I am
> guessing that I am doing the registration, but it is, somehow, overridden.
> Maybe this has to do with it being embedded in a Multiage editor.
> Does that sound right to you?
>
> What is the specific call that registers my action handler for undo
> with the workbench?

IActionBars.setGlobalActionHandler must be called.

>
>
> Thanks, Danny.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:bf13ac$psm$1@eclipse.org...
> > The Eclipse workbench defines a global action for Undo. It appears in
the
> > menubar, and steals CTRL+Z from every control in the Shell. This is the
> > reason that the keystroke is stolen from your viewer.
> >
> > To get undo to be associated with the keystroke, you must register your
> > action handler for undo with the workbench, which is part of what Eric
> > described.
> >
> >
>
>
>
Re: Problems in getting hotkeys to work [message #87388 is a reply to message #87343] Tue, 15 July 2003 16:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: soroker.us.ibm.com

I put in additional explicit calls to
IActionBars.setGlobalActionHandler(...),
but still no keyboard response.

Any other ideas?

Danny.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bf18qs$11d$1@eclipse.org...
>
> "Danny Soroker" <soroker@us.ibm.com> wrote in message
> news:bf15d3$shr$1@eclipse.org...
> > Randy,
> >
> > My code contains all the calls that Eric mentioned, but still
> > the CTRL+SO is not responding. Given what you say, I am
> > guessing that I am doing the registration, but it is, somehow,
overridden.
> > Maybe this has to do with it being embedded in a Multiage editor.
> > Does that sound right to you?
> >
> > What is the specific call that registers my action handler for undo
> > with the workbench?
>
> IActionBars.setGlobalActionHandler must be called.
>
> >
> >
> > Thanks, Danny.
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:bf13ac$psm$1@eclipse.org...
> > > The Eclipse workbench defines a global action for Undo. It appears in
> the
> > > menubar, and steals CTRL+Z from every control in the Shell. This is
the
> > > reason that the keystroke is stolen from your viewer.
> > >
> > > To get undo to be associated with the keystroke, you must register
your
> > > action handler for undo with the workbench, which is part of what Eric
> > > described.
> > >
> > >
> >
> >
> >
>
>
Re: Problems in getting hotkeys to work [message #87452 is a reply to message #87388] Tue, 15 July 2003 18:07 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Sorry, I am not familiar with multi-page editors. Maybe someone on platform
newsgroup could help more.
"Danny Soroker" <soroker@us.ibm.com> wrote in message
news:bf1pfc$j69$1@eclipse.org...
> I put in additional explicit calls to
> IActionBars.setGlobalActionHandler(...),
> but still no keyboard response.
>
> Any other ideas?
>
> Danny.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:bf18qs$11d$1@eclipse.org...
> >
> > "Danny Soroker" <soroker@us.ibm.com> wrote in message
> > news:bf15d3$shr$1@eclipse.org...
> > > Randy,
> > >
> > > My code contains all the calls that Eric mentioned, but still
> > > the CTRL+SO is not responding. Given what you say, I am
> > > guessing that I am doing the registration, but it is, somehow,
> overridden.
> > > Maybe this has to do with it being embedded in a Multiage editor.
> > > Does that sound right to you?
> > >
> > > What is the specific call that registers my action handler for undo
> > > with the workbench?
> >
> > IActionBars.setGlobalActionHandler must be called.
> >
> > >
> > >
> > > Thanks, Danny.
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:bf13ac$psm$1@eclipse.org...
> > > > The Eclipse workbench defines a global action for Undo. It appears
in
> > the
> > > > menubar, and steals CTRL+Z from every control in the Shell. This is
> the
> > > > reason that the keystroke is stolen from your viewer.
> > > >
> > > > To get undo to be associated with the keystroke, you must register
> your
> > > > action handler for undo with the workbench, which is part of what
Eric
> > > > described.
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>
Previous Topic:why no tool change notification in EditDomain
Next Topic:Re: CVS Graph plugin for Eclipse available
Goto Forum:
  


Current Time: Sat May 10 18:28:58 EDT 2025

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

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

Back to the top