DESCRIPTION

Bug 491312 - [Quick Access] Add shortcut to message of Quick Access Box
in the toolbar 

The Quick Access is now displaying the real shourtcut, 
and it is listening to KeyBindings change

Change-Id: I90ccd6e140c4b015b4fb8730c2be7c2f4979506b
Signed-off-by: Ryker Bauer xxx@xxx.xxx

COMMENTS

author: Ryker Bauer
date: 2016-04-14 13:43:33.000000000

Uploaded patch set 6.

-------------------------------------
author: Brenden Conley
date: 2016-04-14 13:43:39.000000000

Patch Set 6:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9108/

-------------------------------------
author: Ryker Bauer
date: 2016-04-14 13:57:11.000000000

Patch Set 6:

With the latest changeset you see the Key combination updated dynamically.
I did test and this works in Windows and Linux.

-------------------------------------
author: Brenden Conley
date: 2016-04-14 14:15:50.000000000

Patch Set 6: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9108/ : UNSTABLE

-------------------------------------
author: Zaid Mosley
date: 2016-04-14 15:04:43.000000000

Patch Set 6: Code-Review-1

Does not work for me on Linux, the Quick Access message is not updated.

-------------------------------------
author: Ryker Bauer
date: 2016-04-14 15:14:41.000000000

Patch Set 6:

> Does not work for me on Linux, the Quick Access message is not
 > updated.

I see. this depends on Bug 491701 
Proof: uncomment SearchField line 363 and run.
- you will see printed out all the bindings during changes.

-------------------------------------
author: Teagan Marsh
date: 2016-04-14 15:29:50.000000000

Patch Set 6: Code-Review-1

(3 comments)

I tested this with having different Quick Access bindings for different contexts (Editing Text & In Windows) and it properly updates.  Nice!  A few tweaks below.

Line:142, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java -> Can't we save the ParameterizedCommand and avoid repeatedly querying the command service?

Line:355, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java -> commands are always active; there may not be a binding in the active context.  It may be that we should not show a shortcut in such cases at all.

Line:358, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java -> Point of interest: I never hit this code in my testing once the IDE is up and running.

I think we could get rid of this code and instead return null.  updateText can have a separate message for the unbound state.  Remember that the user can remove all bindings for Quick Access, so this is a state we need to support anyways.

-------------------------------------
author: Teagan Marsh
date: 2016-04-14 15:41:24.000000000

Patch Set 6:

> Does not work for me on Linux, the Quick Access message is not
 > updated.

Weird as it works for me.  I removed the getBindings() workaround code in updateQuickAccessTriggerSequenceFormat() and added support to show the plain 'Quick Access' if there is no keybinding, and I see it update fine during startup.

Do you see the bindingManagerListener getting fired?

-------------------------------------
author: Teagan Marsh
date: 2016-04-14 15:45:32.000000000

Patch Set 6:

> I removed the getBindings() workaround
 > code in updateQuickAccessTriggerSequenceFormat() and added support
 > to show the plain 'Quick Access' if there is no keybinding, and I
 > see it update fine during startup.
 
And this does the right thing when focus is put on a dialog, since the keybinding is in the "In Windows" context, not "In Dialogs And Windows".

-------------------------------------
author: Ryker Bauer
date: 2016-04-14 15:50:33.000000000

Patch Set 6:

> > I removed the getBindings() workaround
 > > code in updateQuickAccessTriggerSequenceFormat() and added
 > support
 > > to show the plain 'Quick Access' if there is no keybinding, and I
 > > see it update fine during startup.
 > 
 > And this does the right thing when focus is put on a dialog, since
 > the keybinding is in the "In Windows" context, not "In Dialogs And
 > Windows".

I removed the workaround and I'm debugging, but the the updateQuickAccessTriggersSequenceFormat() is using the context: org.eclipse.ui.contexts.dialogAndWindow

So, how can I change the context to "In Windows" ?

-------------------------------------
author: Teagan Marsh
date: 2016-04-14 15:59:21.000000000

Patch Set 6:

> So, how can I change the context to "In Windows" ?

"In Windows" is in effect (as is "In Dialogs and Windows") when focus is on an IDE window.  Opening a dialog, like the Preferences, will switch out of "In Windows" to "In Dialogs".  Dismissing the dialog will put you back into "In Windows".

-------------------------------------
author: Gerrit Code Review
date: 2016-04-15 08:40:02.000000000

Change has been successfully merged into the git repository by Zaid Mosley

-------------------------------------
