Bug 314167 - wikitext should not capture Ctrl+O in task editor
Summary: wikitext should not capture Ctrl+O in task editor
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P1 normal (vote)
Target Milestone: 1.3.0   Edit
Assignee: David Green CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-24 17:02 EDT by Steffen Pingel CLA
Modified: 2011-01-06 10:01 EST (History)
0 users

See Also:


Attachments
patch that creates a new context for the source editor, and registers quick outline for the task editor in that context (3.77 KB, patch)
2010-05-25 11:36 EDT, David Green CLA
no flags Details | Diff
mylyn/context/zip (11.28 KB, application/octet-stream)
2010-05-25 11:36 EDT, David Green CLA
no flags Details
new patch that creates new context hierarchy (3.73 KB, patch)
2010-06-04 12:38 EDT, David Green CLA
no flags Details | Diff
mylyn/context/zip (38.14 KB, application/octet-stream)
2010-06-04 12:38 EDT, David Green CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2010-05-24 17:02:34 EDT
Bug 278102 adds a quick outline for the task editor which conflicts with the WikiText quick outline if a WikiText enabled text field is focused. In all other SDK editors the quick outline is page or editor global rather than specific to controls and the task editor should follow that convention. I suggest to map the WikiText quick outline to Ctrl+Shift+O or to disable it when the task editor context is active.
Comment 1 David Green CLA 2010-05-25 11:36:40 EDT
Created attachment 169845 [details]
patch that creates a new context for the source editor, and registers quick outline for the task editor in that context

Agreed.  Header-based quick outline is probably less useful in the task editor extension.

(In reply to comment #0)
> In all other SDK editors the quick outline is page or editor global rather than specific to
> controls and the task editor should follow that convention. 

The quick outline command in WikiText is attached to the @contextId="org.eclipse.mylyn.wikitext.ui.editor.markupSourceContext"@.  This adheres to convention, what we're doing that's not quite so typical of other Eclipse editors is that we activate this context when the WikiText task editor extension has focus in the task editor.

> I suggest to map the WikiText quick outline to Ctrl+Shift+O or to disable it when the task editor
> context is active.

Disabling makes sense to me.  I don't see the need to have it active in the task editor.

I've created a patch that causes the WikiText markup editor extension to use a new source context for markup editing.  The task editor quick outline command is registered in that new context, making the task editor quick outline come up instead of the markup quick outline.

Steffen, can you please review the patch?
Comment 2 David Green CLA 2010-05-25 11:36:42 EDT
Created attachment 169846 [details]
mylyn/context/zip
Comment 3 Steffen Pingel CLA 2010-05-25 12:03:36 EDT
Thanks. This patch looks good to me.
Comment 4 David Green CLA 2010-05-25 13:08:01 EDT
Patch applied.
Comment 5 Steffen Pingel CLA 2010-06-04 02:28:25 EDT
I still get a popup that prompts me to select the command if I press Ctrl+O in the task editor while a WikiText editing control has focus. I also see two WikiText bindings for Ctrl+O now. David, can you please check what's going on?
Comment 6 David Green CLA 2010-06-04 11:31:00 EDT
I'm not sure how this solution could have possibly worked before, it makes no sense.

A key binding conflict is occurring.  Key binding conflicts are resolved based on logic in org.eclipse.jface.bindings.BindingManager.resolveConflicts(Collection, Map), which can be summarized as follows:
# compare schemes (looking at sheme hierarchy)
# compare contexts (looking at context hierarchy)
# compare binging types (ie: user or system)

We're getting a conflict because:
# schemes are the same
# contexts have no hierarchy overlap
# binding types are always the same (not specified by user preferences)

To resolve this issue we'll have to figure out an approach that prevents the keybinding conflict from occurring in the first place, since conflict resolution will fail to choose a preferred keybinding.

Let's touch base today.
Comment 7 David Green CLA 2010-06-04 12:38:28 EDT
Created attachment 171124 [details]
new patch that creates new context hierarchy

There seems to be no way to prevent a keybinding conflict in this case other than to have one of the contexts not register the keybinding.  To make this work I've created a new supertype for the markupSourceContext context such that the tasks.ui plugin can extend that context instead of the one used by WikiText source editors.  This has the advantage of preserving existing behaviour in WikiText.
Comment 8 David Green CLA 2010-06-04 12:38:30 EDT
Created attachment 171125 [details]
mylyn/context/zip
Comment 9 Steffen Pingel CLA 2010-06-04 16:29:36 EDT
Thanks David. The patch works for me.
Comment 10 David Green CLA 2010-06-04 16:56:53 EDT
Patch applied