Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Copy and paste problems in ToolBar Text widget
Copy and paste problems in ToolBar Text widget [message #557847] Thu, 09 September 2010 08:30 Go to next message
Andreas Scherer is currently offline Andreas SchererFriend
Messages: 6
Registered: September 2010
Junior Member
Hello,

I want to add in the Eclipse status line a new ToolBar containing a Text widget that supports full copy and paste functions. The creation of the ToolBar succeeds (using the extension point org.eclipse.ui.menus), but unfortunately the copy and paste actions are not handled by the Text widget of my ToolBar but by the active workbench part. That means that if for example the active workbench part is an editor, then I can select my Text widget, write text in it, but when pressing CTRL+P the content of the clipboard is inserted somewhere into the editor text instead of my widget.

My first fix tried to get the active workbench part, and in case it's an editor, get its action bars, and as soon as my Text widget gets the focus, set new global action handlers.
My second fix tried to call the handler service (IHandlerService), and as soon as my Text widget gets the focus, activate new handlers for the command ids (like org.eclipse.ui.edit.paste).

I also thought about changing what is active in my workbench window, but all these fixes did now work properly, so I tried another fix: I implemented a new command, defined it with the extension point org.eclipse.ui.commands, then I defined new key bindings for CTRL+C/V/X with extension point org.eclipse.ui.bindings, I defined a new context for my key bindings, and as soon as my Text widget gets the focus, I activate the context.

This solution works fine with copy and paste, but I see that there are some more editor functions like CTRL+SHIFT+LEFT/RIGHT to select words, and such functions still do not work properly. It would be ok if these editor function would not work at all, but it is somehow weird that editing text in my Text widget and pressing CTRL+SHIFT+LEFT selects text somewhere else in the active editor.

What is the best solution for this problem?

Andreas
Re: Copy and paste problems in ToolBar Text widget [message #558091 is a reply to message #557847] Fri, 10 September 2010 07:41 Go to previous messageGo to next message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
Hi,

This question belongs to Eclipse Platform, please post your question to the Eclipse Platform forum to get the right response.


Lakshmi P Shanmugam
Re: Copy and paste problems in ToolBar Text widget [message #558322 is a reply to message #558091] Sat, 11 September 2010 08:58 Go to previous message
Andreas Scherer is currently offline Andreas SchererFriend
Messages: 6
Registered: September 2010
Junior Member
ok, I will try my luck there....thanks Smile
Previous Topic:jFace Viewer not allowing deselect using ctrl click
Next Topic:Re: Deselecting a table item on second selection
Goto Forum:
  


Current Time: Tue Apr 23 16:02:43 GMT 2024

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

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

Back to the top