Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 399831

Summary: Many broken shortcuts in multi-page editors
Product: [Eclipse Project] Platform Reporter: Grzegorz Grzybek <gr.grzybek>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: curtis.windatt.public, daniel_megert, david_williams, emoffatt, ian.trimble, john.arthorne, thatnitind, vrubezhny
Version: 4.2.1Flags: daniel_megert: pmc_approved+
john.arthorne: pmc_approved+
emoffatt: review+
Target Milestone: 4.2.2   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=426557
Whiteboard:
Bug Depends on: 399396, 399457    
Bug Blocks:    
Attachments:
Description Flags
Use the correct partSite daniel_megert: review+

Description Grzegorz Grzybek CLA 2013-02-04 03:42:49 EST
First - it's neither SpringSource Tool Suite nor WTP's fault. I've upgraded from 4.3m4 to 4.3m5 (and few days earlier to some I-build) and in XML Editors (HTML Editors are fine) I can't use many shortcuts such as: Delete line (CTRL+D), move line up/down (ALT+up/down) or duplicate line up/down (ALT+CTRL+up/down).

I've not upgraded WTP - just Eclipse SDK.

Key bindings are OK. E.g., CTRL+D is in "Editing Text" - that's why I chose "Component = Text"

regards
Grzegorz Grzybek
Comment 1 Dani Megert CLA 2013-02-04 03:46:39 EST
Do the key bindings work in Text and Java editors?
Comment 2 Grzegorz Grzybek CLA 2013-02-04 03:54:04 EST
Yes - they do. Even HTML editor (which is closer to WTP than Java Editor IMO) works fine. Just XML Editor is broken.

I have M2E (+M2E-WTP) and neither M2E opened XMLs not standard XML Editors don't work.
Comment 3 Grzegorz Grzybek CLA 2013-02-04 03:56:02 EST
Also, I have several key binding conflicts, but they don't include ALT+Up:

!MESSAGE A conflict occurred for ALT+SHIFT+ARROW_UP:
Binding(ALT+SHIFT+ARROW_UP,
	ParameterizedCommand(Command(org.eclipse.wst.sse.ui.structure.select.enclosing,Select Enclosing Element,
		Expand selection to include enclosing element,
		Category(org.eclipse.ui.category.edit,Edit,null,true),
		org.eclipse.ui.internal.MakeHandlersGo@4daa3d77,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.wst.sse.ui.structuredTextEditorScope,,,system)
Binding(ALT+SHIFT+ARROW_UP,
	ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.select.enclosing,Select Enclosing Element,
		Expand selection to include enclosing element,
		Category(org.eclipse.ui.category.edit,Edit,null,true),
		org.eclipse.ui.internal.MakeHandlersGo@32c00f48,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.jdt.ui.javaEditorScope,,,system)
Comment 4 Grzegorz Grzybek CLA 2013-02-04 04:00:58 EST
I've just reverted to 4.3.0.I20121214-073 and shortcuts in XML Editors work fine..
Comment 5 Dani Megert CLA 2013-02-04 04:03:14 EST
I assume you already verified this, but just to be sure:
- there is only one command for e.g. 'Delete Line' on the 'Keys' preference page
- Ctrl+D is only used once on the 'Keys' preference page
Comment 6 Grzegorz Grzybek CLA 2013-02-04 04:07:14 EST
Actually - no (neither in 4.3m4 nor in 4.3m5) - there's also CTRL-D for "Delete line" in "Embedded Xtext Editor context" - but that's not a problem in 4.3m4.

Thanks for looking into it ;)
Comment 7 Dani Megert CLA 2013-02-04 05:51:31 EST
Thanks for reporting this bug!

Many key bindings for the XML Editor are broken when installing it on top of M5 or our latest Juno SR 2 candidate.

The problem got introduced with the fix for bug 399396.
Comment 8 Dani Megert CLA 2013-02-04 06:06:06 EST
Test Case:

1. start new workspace
2. install 'Eclipse XML Editors and Tools' from the Juno repository
3. create an XML file with some content
4. try e.g. Ctrl+D to delete a line
Comment 9 Dani Megert CLA 2013-02-04 06:13:28 EST
As far as I can see, there is no workaround.
Comment 10 Dani Megert CLA 2013-02-04 06:20:08 EST
Paul, if you think there's a safer and better way than to just revert the two changes for now, please add a new patch that can be tested.
Comment 11 Paul Webster CLA 2013-02-04 08:32:09 EST
OK, looking at it now.

PW
Comment 12 Paul Webster CLA 2013-02-04 09:47:31 EST
Created attachment 226508 [details]
Use the correct partSite

The problem was our new handler expression was using the MultiPageEditorSite as the part site, but the MPES is never exposed to the expression subsystem.

In 3.x they also had a step where the parent KeyBindingService (the one for the editor, like XMLEditorPart) went through and actually replaced the inner part submissions to use its own workbenchPartSite.  http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.ui.workbench/Eclipse%20UI/org/eclipse/ui/internal/KeyBindingService.java?h=R3_8_maintenance#n438

This fix uses the correct EditorSite when creating the submissions in the first place, and CTRL+D functions again.

PW
Comment 13 Dani Megert CLA 2013-02-04 10:16:16 EST
(In reply to comment #12)

Thanks for the quick response Paul!

> In 3.x they also had a step where the parent KeyBindingService (the one for
> the editor, like XMLEditorPart) went through and actually replaced the inner
> part submissions to use its own workbenchPartSite. 
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.
> eclipse.ui.workbench/Eclipse%20UI/org/eclipse/ui/internal/KeyBindingService.
> java?h=R3_8_maintenance#n438

Right, I can remember that part now. Sorry I didn't see this when I reviewed the original fix last week.
Comment 14 Dani Megert CLA 2013-02-04 10:17:06 EST
Comment on attachment 226508 [details]
Use the correct partSite

I reviewed the patch and verified that it works. I also verified that the original bug 399396 is still fixed.
Comment 15 John Arthorne CLA 2013-02-04 10:24:37 EST
It is also reproducible using the Eclipse SDK. Open a PDE manifest editor and try Ctrl+D in the MANIFEST.MF pane (raw text view).
Comment 16 Dani Megert CLA 2013-02-04 10:26:21 EST
(In reply to comment #15)
> It is also reproducible using the Eclipse SDK. Open a PDE manifest editor
> and try Ctrl+D in the MANIFEST.MF pane (raw text view).

Yes, I already updated the summary. All multi-page editors are affected.
Comment 17 Paul Webster CLA 2013-02-04 10:50:26 EST
Eric, please review this patch.

PW
Comment 18 Dani Megert CLA 2013-02-04 11:14:56 EST
+1 to fix this in Juno SR2 RC4 and re-spin M5.
Comment 19 Eric Moffatt CLA 2013-02-04 11:36:17 EST
As far as it goes the patch looks OK...

As some point we're going to have to make this while layer deterministic (which it is demonstrably not ATM).
Comment 21 Curtis Windatt CLA 2013-02-04 12:04:35 EST
+1 The fix in master fixes the shortcuts in the PDE editors.
Comment 22 David Williams CLA 2013-02-04 12:55:55 EST
I have disabled all repos in 'tagging' except for platform.ui (at Dani's suggestion, in case others have started on M6 already) 

http://git.eclipse.org/c/platform/eclipse.platform.releng.maps.git/commit/?id=f2b0bc37841ea6d32dbbe2c31cd0d7b8fb897ebc

And scheduled the a re-build to start at 2 PM Eastern, today. (Monday, 2/4).
Comment 23 David Williams CLA 2013-02-04 18:46:49 EST
(In reply to comment #22)
> I have disabled all repos in 'tagging' except for platform.ui (at Dani's
> suggestion, in case others have started on M6 already) 
> 
> http://git.eclipse.org/c/platform/eclipse.platform.releng.maps.git/commit/
> ?id=f2b0bc37841ea6d32dbbe2c31cd0d7b8fb897ebc
> 

I've reverted this change to repositories.txt, so nightly and tomorrow's I-build should be normal builds towards M6. The "changed" record sent in email may look funny, since it should mention something about reverting this bug (and not sure it capture my full comment about commenting out other repositories).
Comment 24 Grzegorz Grzybek CLA 2013-02-05 00:02:12 EST
Thanks for great work!

If only WTP team could fix 323157 (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=323157#c7) that fast... I've posted full analysis (and I'm using my patched version of org.eclipse.wst.wsi_1.0.500.v201203081939.jar for 3 months now) of the simple problem there...

regards
Grzegorz Grzybek
Comment 25 Dani Megert CLA 2013-02-05 05:26:11 EST
Verified in 4.2-M20130204-1200 and I20130204-1400 (4.3 M5a).
Comment 26 Grzegorz Grzybek CLA 2013-02-06 01:18:09 EST
Thanks. I20130204-1400 works great!
Comment 27 Nitin Dahyabhai CLA 2013-02-08 14:08:50 EST
*** Bug 400354 has been marked as a duplicate of this bug. ***
Comment 28 Nick Sandonato CLA 2013-02-08 17:31:27 EST
*** Bug 400372 has been marked as a duplicate of this bug. ***