Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Copy & Paste in forms pages
Copy & Paste in forms pages [message #1777245] Mon, 27 November 2017 13:48 Go to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
When building Forms based editors I experience classic cut/copy/paste not working using ctrl-c, ctrl-v in Text fields. While this works out of the box fow classic SWT text widgets I wonder what needs to be done to make this work in forms based editors.

Is this a platform bug?

Christian
Re: Copy & Paste in forms pages [message #1777590 is a reply to message #1777245] Thu, 30 November 2017 14:59 Go to previous messageGo to next message
Eclipse UserFriend
I use cut/copy/paste often in the PDE manifest editors, which are also Forms editors, without issue. So you're hitting something odd.

The implementation for cut/copy/paste is handled by org.eclipse.ui.internal.handlers.WidgetMethodHandler. This is the default handler for the cut/copy/paste commands (e.g., 'org.eclipse.ui.edit.copy'), which are bound to M1+C/M1+X/M1+V in org.eclipse.ui's plugin.xml. Try putting in some breakpoints in WidgetMethodHandler and see what happens.

Brian.
Re: Copy & Paste in forms pages [message #1780433 is a reply to message #1777590] Mon, 22 January 2018 11:49 Go to previous messageGo to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
I remember once raising a bug because the PDE feature editor did not support paste operations for the license text.

It seems WidgetMethodHandler.execute() is not called on cut/copy/paste for form editors by default. At least a breakpoint does not get triggered while it perfectly works for textboxes in calssic views.
I guess the handler needs to be registered somehow.

Any information on how to do this?
Re: Copy & Paste in forms pages [message #1780438 is a reply to message #1780433] Mon, 22 January 2018 13:13 Go to previous messageGo to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
Ok, I see my problem is actually related to EMF as my use case is similar to the described one:
https://www.eclipse.org/forums/index.php?t=msg&th=133456&goto=416416&

Will try to implement the proposed solution.
Re: Copy & Paste in forms pages [message #1780440 is a reply to message #1780438] Mon, 22 January 2018 13:21 Go to previous message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
In case anyone looks for the solution, add following line to your ActionBarContributor:
public class MyActionBarContributor extends EditingDomainActionBarContributor {

	@Override
	public void activate() {
		super.activate();

		// add support for 'classic' cut/copy/paste handlers
		new TextActionHandler(getActionBars());
	}
}
Previous Topic:E3 to E4 Migration - e4view with toolbar
Next Topic:Programmatically detach and insert part
Goto Forum:
  


Current Time: Thu Mar 28 22:11:46 GMT 2024

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

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

Back to the top