Bug 58126

Summary: Output Window keybindings not customizable or synchronized with others
Product: platform Reporter: sviyer <sviyer>
Component: Output WindowAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P3 CC: arittner, holub, jglick, psomol, sdedic, theofanis
Version: 5.xKeywords: PLAN
Target Milestone: 7.3   
Hardware: All   
OS: All   
Whiteboard:
Issue Type: DEFECT Exception Report:
Bug Depends on:    
Bug Blocks: 211167    
Attachments: Patch
Patch
Patch

Description sviyer 2005-04-20 23:34:14 UTC
As you browse through the message window ( ant, compiler or other output) you
want to search and navigate using the same keys that you use with the editor.

Therefore, if Editor search key (or any other relevant key for that matter) is
remapped to F5 it should also work in the message window. Presently this is not
the case.

This is a nuisance because you get used to the editor remapped keys and
subconciously use it in the message pane, only to be frustrated each time.

This happens a number of times in your day to day work, please treat as high
priority.
Comment 1 Roman Strobl 2005-04-26 14:52:57 UTC
Reassigned from ide issues to core->output. Feel free to reassign.
Comment 2 Milos Kleint 2005-05-05 09:08:14 UTC
accepting, this ought to be fixed. I suppose it's not the case for find only,
but also find next, copy, close, save as.
Comment 3 Milos Kleint 2005-11-18 15:15:09 UTC
*** Issue 68937 has been marked as a duplicate of this issue. ***
Comment 4 Milos Kleint 2005-12-05 08:40:01 UTC
to allow user changes of output window shortcuts is not likely fixable in 5.0
timeframe, requires a complete rewrite of the action support in the output window.
 
Comment 5 Antonin Nebuzelsky 2008-02-07 15:53:14 UTC
Reassigning to new module owner Tomas Holy.
Comment 6 Martin Entlicher 2011-02-09 14:57:07 UTC
*** Bug 188486 has been marked as a duplicate of this bug. ***
Comment 7 Jaroslav Havlin 2012-04-10 11:37:27 UTC
Created attachment 118047 [details]
Patch
Comment 8 Jaroslav Havlin 2012-04-10 11:45:08 UTC
A patch with fix attached.

Keymap Options API is now used to retrieve shortcuts for editor actions that can be reused in output window (Find, Find Next, Copy, Paste, Select all, ...) and to create a new KeymapManager.

Jesse, Fanis, please, is this solution correct? It is quite complicated, but I couldn’t find any better way to reuse shortcuts already defined for editor actions.

Fanis, can I please add a new friend module to Keymap Options API?

Petr, can you please approve this UI change? 
Several hard-coded key shortcuts are now customizable in Tools -> Options -> Keymap, category Output Window. Default shortcuts for new keymap actions are equal to formerly hard-coded shortcuts.
Comment 9 Jesse Glick 2012-04-10 17:26:04 UTC
I do not know much about options.keymap and editor keybindings in general; you need a review from someone on the editor team. The proposed patch does feel too complicated, especially the copying of editor.settings.storage.spi.support.StorageSupport. Possibly we need a generalized version of options.keymap which is designed to manage keybindings from multiple types of windows; currently there are just two kinds of bindings: global and editor. I doubt this is a candidate for fixing in 7.2 past feature freeze.
Comment 10 Jaroslav Havlin 2012-04-11 07:54:42 UTC
*** Bug 166545 has been marked as a duplicate of this bug. ***
Comment 11 Svata Dedic 2012-04-11 14:04:29 UTC
Re. storage - this is 3rd form :) in addition to .instance file-based (layer provider), and editor's keybinding XML configurations. Maybe it's really time to unify those in the keymap module. There could be other users as well (navigator, and even popup windows like call hierarchy).

re. the patch 

[SD01] since it's the ShortcutsFinder implementation which uses "nice" string representation for shortcut (unlike Utilities.keyToString), I would be in favour to make a supplemental interface in keymap.options that would map String[] to KeyStroke[] - implementation is already in keymap options module & output tab could use it.
Comment 12 Jaroslav Havlin 2012-04-11 15:11:25 UTC
Thank you for your comments.

> I doubt this is a candidate for fixing in 7.2 past feature freeze.
I'll postpone fixing it.

> Maybe it's really time to unify those in the keymap module
I think this module is quite a good place, as it can easily provide custom shortcuts for currently selected keymap profile.

> I would be in favour to make a supplemental interface in keymap.options that 
> would map String[] to KeyStroke[]
I agree. 
I would also like to have a standard way to select the most appropriate shortcut to be shown in menus (e.g. not to show FIND key on platforms where FIND key is not usually present, but to show Ctrl+F alternative shortcut instead).
Comment 13 Jaroslav Havlin 2012-08-07 15:31:45 UTC
Created attachment 122839 [details]
Patch

Updated Patch

Class org.netbeans.modules.options.keymap.Utils (private) renamed to 
org.netbeans.core.options.keymap.api.KeyStrokeUtils (friend private).
Added method getKeyStrokesForAction.

There is also new method refreshActionCache and some changes in KeymapViewModel. Without these changes, outdated keystrokes are returned. It is a bad practice to refresh actions before reading keystrokes, but I was not able to find a better way to retrieve current data. Please, do you have some idea how to fix this?

Svata,  could you please review the changes?
Comment 14 Jaroslav Havlin 2012-08-29 14:03:21 UTC
Created attachment 123704 [details]
Patch

Patch updated (after discussion with Svata):

 - Added Common Annotations for methods in KeyStrokeUtils
 - Code Style improved
 - GetKeyStrokesForAction supports multi-key shortcuts (return list of arrays)
 - Added a test case

Unless there are any other problems, I'll integrate it tomorrow afternoon.
Thank you.
Comment 15 Svata Dedic 2012-08-29 14:29:46 UTC
OK, thanks!
Comment 16 Jaroslav Havlin 2012-08-30 16:07:43 UTC
Patch integrated as http://hg.netbeans.org/core-main/rev/06006afbe7cf
Comment 17 Quality Engineering 2012-09-01 01:12:22 UTC
Integrated into 'main-golden', will be available in build *201209010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/06006afbe7cf
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #58126: Output Window keybindings not customizable or synchronized with others
Comment 18 Quality Engineering 2012-09-04 01:09:48 UTC
Integrated into 'main-golden', will be available in build *201209040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/cf2079346a97
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #58126: Fixing specification version
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo