Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Using key bindings for cut'n'paste in a plug-in?
Using key bindings for cut'n'paste in a plug-in? [message #133086] Fri, 19 September 2003 14:43 Go to next message
Eclipse UserFriend
Originally posted by: oliver.klee.fit.fraunhofer.de

Hi,

as a programming project at the University of Bonn, we're developing a
refactoring plug-in that displays its data as a TreeViewer. For that
TreeViewer, we have implemented cut and paste (using the context menu),
but we cannot find a way to get key bindings for CTRL+X/CTRL+V to work.

Does anyone know how to do this?

Thanks in advance,


Oliver Klee
Re: Using key bindings for cut'n'paste in a plug-in? [message #133131 is a reply to message #133086] Fri, 19 September 2003 17:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

Assuming this is a view, take a look at IActionBars.setGlobalActionHandler
(you access the action bars via myViewPart.getViewSite().getActionBars())

Simon :-)

"Oliver Klee" <oliver.klee@fit.fraunhofer.de> wrote in message
news:bkf4i3$30e$1@eclipse.org...
> Hi,
>
> as a programming project at the University of Bonn, we're developing a
> refactoring plug-in that displays its data as a TreeViewer. For that
> TreeViewer, we have implemented cut and paste (using the context menu),
> but we cannot find a way to get key bindings for CTRL+X/CTRL+V to work.
>
> Does anyone know how to do this?
>
> Thanks in advance,
>
>
> Oliver Klee
>
Re: Using key bindings for cut'n'paste in a plug-in? [message #133756 is a reply to message #133131] Mon, 22 September 2003 08:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

You have to bind your actions to the corresponding commands:

actionBars.setGlobalActionHandler(IWorkbenchActionConstants. COPY,
yourCopyAction);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants. CUT,
yourCutAction);


HTH
Dani

Simon Arsenault wrote:
> Assuming this is a view, take a look at IActionBars.setGlobalActionHandler
> (you access the action bars via myViewPart.getViewSite().getActionBars())
>
> Simon :-)
>
> "Oliver Klee" <oliver.klee@fit.fraunhofer.de> wrote in message
> news:bkf4i3$30e$1@eclipse.org...
>
>>Hi,
>>
>>as a programming project at the University of Bonn, we're developing a
>>refactoring plug-in that displays its data as a TreeViewer. For that
>>TreeViewer, we have implemented cut and paste (using the context menu),
>>but we cannot find a way to get key bindings for CTRL+X/CTRL+V to work.
>>
>>Does anyone know how to do this?
>>
>>Thanks in advance,
>>
>>
>>Oliver Klee
>>
>
>
>
Re: Using key bindings for cut'n'paste in a plug-in? [message #134254 is a reply to message #133756] Tue, 23 September 2003 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: oliver.klee.fit.fraunhofer.de

Hi,

Daniel Megert wrote:
> You have to bind your actions to the corresponding commands:
>
> actionBars.setGlobalActionHandler(IWorkbenchActionConstants. COPY,
> yourCopyAction);
> actionBars.setGlobalActionHandler(IWorkbenchActionConstants. CUT,
> yourCutAction);

Thanks a lot ... now at least I've managed to get the menu items to
work. But still the corresponding action handlers don't get called when
I press e.g. CTRL+X. =:-((

Is there anything I have to do to get the accelerator keys to work as
well? Help...!

Thanks in advance,



Oliver
Re: Using key bindings for cut'n'paste in a plug-in? [message #134908 is a reply to message #134254] Wed, 24 September 2003 11:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Oliver Klee wrote:

> Hi,
>
> Daniel Megert wrote:
>
>> You have to bind your actions to the corresponding commands:
>>
>> actionBars.setGlobalActionHandler(IWorkbenchActionConstants. COPY,
>> yourCopyAction);
>>
>> actionBars.setGlobalActionHandler(IWorkbenchActionConstants. CUT,
>> yourCutAction);
>
>
> Thanks a lot ... now at least I've managed to get the menu items to
> work. But still the corresponding action handlers don't get called when
> I press e.g. CTRL+X. =:-((
>
> Is there anything I have to do to get the accelerator keys to work as
> well? Help...!
>
> Thanks in advance,
>
>
>
> Oliver
>
Does your code which sets the handler get called? Is your editor
embedded in a multi-page editor?

Dani
Re: Using key bindings for cut'n'paste in a plug-in? [message #135750 is a reply to message #134908] Thu, 25 September 2003 08:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: oliver.klee.fit.fraunhofer.de

Daniel Megert wrote:
> Oliver Klee wrote:
>> Thanks a lot ... now at least I've managed to get the menu items to
>> work. But still the corresponding action handlers don't get called
>> when I press e.g. CTRL+X. =:-((
>>
>> Is there anything I have to do to get the accelerator keys to work as
>> well? Help...!
>>
> Does your code which sets the handler get called? Is your editor
> embedded in a multi-page editor?

The code setting the handler gets called (as the menu items that use the
same handlers work).

Yes, the editor is part of a multi-page editor.

Thanks in advance,


Oliver
Re: Using key bindings for cut'n'paste in a plug-in? [message #135843 is a reply to message #135750] Thu, 25 September 2003 12:43 Go to previous message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Oliver Klee wrote:
> Daniel Megert wrote:
>
>> Oliver Klee wrote:
>>
>>> Thanks a lot ... now at least I've managed to get the menu items to
>>> work. But still the corresponding action handlers don't get called
>>> when I press e.g. CTRL+X. =:-((
>>>
>>> Is there anything I have to do to get the accelerator keys to work as
>>> well? Help...!
>>>
>> Does your code which sets the handler get called? Is your editor
>> embedded in a multi-page editor?
>
>
> The code setting the handler gets called (as the menu items that use the
> same handlers work).
>
> Yes, the editor is part of a multi-page editor.

This might be caused by one of the known problems with multi-page
editors. Check bugzilla to find out more about them.

Dani

>
> Thanks in advance,
>
>
> Oliver
>
Previous Topic:Shortcut keys for various tasks
Next Topic:To save IEditorPart contents, created using IStorageEditorInput
Goto Forum:
  


Current Time: Fri Apr 26 20:51:52 GMT 2024

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

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

Back to the top