Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324187 - [find/replace] more buttons should not take focus when mnemonic is pressed in text fields
Summary: [find/replace] more buttons should not take focus when mnemonic is pressed in...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Rajesh CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-01 08:45 EDT by Markus Keller CLA
Modified: 2010-09-14 07:40 EDT (History)
1 user (show)

See Also:


Attachments
Patch (5.54 KB, patch)
2010-09-12 16:33 EDT, Rajesh CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.