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

Bug 324187

Summary: [find/replace] more buttons should not take focus when mnemonic is pressed in text fields
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: Rajesh <rthakkar>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: deepakazad
Version: 3.7   
Target Milestone: 3.7 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch markus.kell.r: iplog+

Description Markus Keller CLA 2010-09-01 08:45:55 EDT
I20100831-1001, follow-up to bug 319560

The behavior of the Find/Replace dialog is nice when I press one of the push button mnemonics. A similar behavior would also be helpful for the other (checkbox and radio) buttons. I often start typing a pattern and then have to switch the Regex checkbox. After that, the focus is gone and I have to put it back the find field.

Request:
If (and only if) the focus is in one of the text fields, a mnemonic press should keep the focus in the text field (but still execute the mnemonic).
Comment 1 Rajesh CLA 2010-09-12 16:33:11 EDT
Created attachment 178707 [details]
Patch
Comment 2 Markus Keller CLA 2010-09-12 17:41:04 EDT
Thanks, committed to HEAD with a bugfix and a few nitpicks:

- added "&& button.isEnabled()" to the traverse listener (in regex mode, some buttons are disabled)

- "(button.getStyle() & SWT.PUSH) == SWT.PUSH" should be written as
  "(button.getStyle() & SWT.PUSH) != 0" (shorter, removes redundancy).

- if-else clauses should be written with either blocks or with no blocks (no mixing)

- replaced "a map" with "{@link #fMnemonicButtonMap}"
Comment 3 Deepak Azad CLA 2010-09-14 07:40:57 EDT
Verified for 3.7M2 on Linux with I20100914-0100.