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: 197
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
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 788
Registered: January 2012
Senior Member

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.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
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: 197
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: 197
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: 197
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: Fri Nov 16 12:16:52 GMT 2018

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

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

Back to the top