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 145415 - Typing letter in the Set Action dialog removes accelerator's modifiers
Summary: Typing letter in the Set Action dialog removes accelerator's modifiers
Status: RESOLVED WONTFIX
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-28 13:20 UTC by Petr Dvorak
Modified: 2012-12-03 17:52 UTC (History)
0 users

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 Petr Dvorak 2008-08-28 13:20:38 UTC
NB: 20080827

1. Invoke "Set Action" above the jButton
2. Check "Ctrl" and "Alt" in the Accelerator section
3. Type 'B' in the Letter field
-> Ctrl and Alt are incorrectly unchecked

Checkboxes ctrl/alt/shift/meta should be updated if and only if a modifier key is pressed together with a letter, maybe
a brief explanation could be in the dialog.

Note: You should have in mind that user who sees this dialog for the first time see checkboxes and a textfield.
Therefore, he/she would probably think that he/she can check the checkboxes and fill something in the field => if user
wants to assign "Ctrl+Shift+B", he/she checks Ctrl, checks Shift and then presses 'B' in the Letter field. He/She is
probably not aware that modification of the textfield causes checkbox state to be changed.
Comment 1 Petr Dvorak 2008-08-28 13:47:31 UTC
There is a subsequent issue:
1. Open Set Action dialog
2. Check Ctrl
3. Check Alt
4. Do not set any letter and press OK
-> invalid accelerator is generated

Another (worse?) solution would be making those checkboxes disabled, suggesting they cannot be edited by user. They
would just change their state if user held Ctrl/Alt/... while pressing key in the Letter field.
Comment 2 Jan Stola 2008-08-29 10:19:02 UTC
I have fixed the first part of this issue e.g. the modifiers are not changed when no modifier is pressed (= when just 
letter is pressed).

Modified file: http://hg.netbeans.org/main?cmd=changeset;node=0a53114a97e3
Comment 3 Jan Stola 2008-08-29 14:52:43 UTC
I have fixed the second part as well. The OK button of the dialog is disable when some modifier is selected and no 
key/letter is specified. The letter text-field also reacts only when some key/letter is pressed (e.g. doesn't react 
on 'modifiers-only' keystrokes).

Modified files: http://hg.netbeans.org/main?cmd=changeset;node=ad7ec3e72a6c
Comment 4 Petr Dvorak 2008-09-17 17:08:01 UTC
The second part is still not fixed in:

Product Version: NetBeans IDE Dev (Build 200809170201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13
System: Linux version 2.6.24-19-generic running on i386; UTF-8; en_US (nb)

You can press OK button when no "Letter" is set and modifiers are set.

To reproduce:

1. Invoke "Set Action" above JButton in JFrame form (in Java Desktop Application)
2. Set "Create New Action" in Action field
3. Fill in "Action's Method" field
4. Check Alt and Ctrl checkboxes
5. Push OK
-> reopen set action dialog for the button and see the resource bundle -> key with code 0 is used
Comment 5 Jan Stola 2008-09-18 10:43:57 UTC
Reproducible - it works correctly when you invoke the action property editor using '...' button in property sheet, but 
it doesn't work when you invoke it using Set Action menu item. I haven't considered this use-case in the previous fix. 
The dialog invoked through Set Action menu item doesn't support the mechanism (PropertyEnv) that I used in the fix.
Comment 6 Tomas Pavek 2012-12-03 17:52:56 UTC
This is part of the Swing Application Framework which is no longer supported by NetBeans.