This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 222400 - Regression: Keybinding missing for REPLACE ALL
Summary: Regression: Keybinding missing for REPLACE ALL
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Search (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P4 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
: 224236 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-19 14:50 UTC by _ gtzabari
Modified: 2012-12-31 01:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2012-11-19 14:50:36 UTC
Product Version: NetBeans IDE Dev (Build 201211150001)
Java: 1.7.0_09; Java HotSpot(TM) 64-Bit Server VM 23.5-b02
Runtime: Java(TM) SE Runtime Environment 1.7.0_09-b05
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

1. With focus in the editor hit CTRL+H
2. Notice there is no key binding for "replace all".
3. This is a regression relative to version 7.2.1
Comment 1 Svata Dedic 2012-11-20 15:15:59 UTC
Not reproduced in a clean build. CTRL-H works in the editor, and Replace All is visible & enabled in main menu.

If you carried your userdir from a previous version, please zip & attach the config/ area for investigation where migration broke; thanks.
Comment 2 _ gtzabari 2012-11-20 15:19:43 UTC
"Replace All is visible and enabled in the main menu"

That's not the point. Yes, the button is visible and enabled but the mnemonic is not. The "A" in Replace All is not underlined and you can't hit "A" on the keyboard to trigger the operation. This used to work in the past. Are you saying that on your end both of these work fine?

Did you try reproducing the problem in the exact same build I reported? If not, which build did you use?
Comment 3 Svata Dedic 2012-11-20 15:34:30 UTC
Aha, I see. You refer to the action buttons in the mini-window at the bottom. Sorry for confusion, confirmed.

The shortcuts have been removed because of issue #218576; not sure whether that issue can be solved more cleanly - e.g. override accelerators just for the search bar, but not for the editor.
Comment 4 Milutin Kristofic 2012-11-20 16:13:35 UTC
Shift+Enter in replace with field is not enough?

R - run
E - edit
P - profile
L - replace with
A - is for refactoring
C - match case

E 
A
L
L


I don't see free mnemonic.
Comment 5 _ gtzabari 2012-11-20 16:54:51 UTC
The entire concept of context-independent mnemonics is going to kill you :) I think it's a lot more scalable to have all mnemonics be context-sensitive. In fact, we already do this.

CTRL+F in the editor means one kind of Find operation, but in the Projects tab means another. I argue that context-sensitive mnemonics isn't a UI bug, it's actually beneficial! So long as it's obvious which component has focus at any given time the behavior should be intuitive.

I don't like SHIFT+Enter because it's not intuitive. There is no underlined letter making it impossible for users to learn about it.
Comment 6 Milutin Kristofic 2012-11-20 17:21:37 UTC
Shortcuts for actions and mnemonics are different story in netbeans. Context-sensitive mnemonics would be a huge change in whole netbeans. 


On the other side, I am not sure, if it is more useful to have mnemonic for replace with field or for replace all.
Comment 7 _ gtzabari 2012-11-20 17:38:12 UTC
Replace once is definitely more important than Replace All with respect to key bindings. I expect ENTER to bind to OK/Apply or in this case "Replace once".

I don't see what else you can really do here if you rule out context-sensitive mnemonics. Keep in mind the old behavior was essentially context-sensitive mnemonics (Replace All overriding Refactor).

Here is a slightly less drastic proposal:

Top-level dialogs may not use ALT key bindings to avoid conflict with the pull-down menus, but secondary dialogs (such as Find, Replace, code hints, etc) should be free to override the pull-down menus.

In the old behavior, Find/Replace was implemented as a pop-up window and while it had focus the pull-down menus did not apply. The problem arose when the functionality was converted into an in-window component.

If you want to make this even more obvious, blank out the pull-down menus while secondary dialogs have focus. Users can simply hit ESC to get back to the top-level dialog and re-gain access to pull-down menus.

I'm not sure how to fix this problem if overriding mnemonics is not possible.
Comment 8 _ gtzabari 2012-11-20 17:52:55 UTC
As a side-note, I use Replace All *far* more often than the Refactor pull-down menu. If you pull up statistics from the exception reporter I bet you will find the same is true for the Netbeans community at large.

The fact that we lose Replace All productivity in favor of this pulldown menu is a very strong "UI smell".
Comment 9 Milutin Kristofic 2012-11-21 14:21:23 UTC
Ok, I found this compromise.

Replace All will have mnemonic P. Replacebar is not used as often as Searchbar and Profile is one of the least used menus. 

http://hg.netbeans.org/jet-main/rev/d2d8834e431f
Comment 10 Quality Engineering 2012-11-22 02:45:51 UTC
Integrated into 'main-golden', will be available in build *201211220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d2d8834e431f
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #222400 - Regression: Keybinding missing for REPLACE ALL
Comment 11 _ gtzabari 2012-11-27 15:32:58 UTC
sdedic,

Sorry, I really should have read issue #218576 before posting my last reply. I agree with you that the ideal solution is to override accelerators for the search bar, but not the editor. The above fix works, but it has the same problem as  issue #218576 in that if you open the replace dialog, then click in the editor, hitting ALT+P will trigger "replace all" instead of "profile".

Are you able to detect whether the editor or search bar has focus and direct the accelerator to the main menu or search bar? If so, I think we should change the accelerator back from "P" to "A" and simply use that solution.

Reopening the issue until we figure this out.
Comment 12 _ gtzabari 2012-11-27 15:36:28 UTC
mkristofic,

My last post is actually meant for you since you're assigned this issue.
Comment 13 Milutin Kristofic 2012-11-27 15:46:12 UTC
gtzabari,
I won't implement accelators for individual components. First of all, we use default java/swing implementation. And there is netbeans implementation of Mnemonics combined with Bundles. I also check situation in intellj idea and they have same problems. It's overkill for such small usecase.

Bug #218576 was about Findbar and this issue is about replace all.

You needed keybinding for replace all, I provide Alt+P. It's the best compromise. 

You can make new enhencement for Mnemonics per component to platform.
Comment 14 _ gtzabari 2012-11-27 16:01:43 UTC
mkristofic,

I understand. I filed issue #222843. Hopefully this can be addressed in a more appropriate manner in the platforms module. Thank you.
Comment 15 Milutin Kristofic 2012-11-27 16:04:28 UTC
Thank you.
Comment 16 Milutin Kristofic 2012-12-31 01:11:39 UTC
*** Bug 224236 has been marked as a duplicate of this bug. ***