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 67187 - [50cat] ALT-U, U not working
Summary: [50cat] ALT-U, U not working
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Miloslav Metelka
URL:
Keywords: REGRESSION, T9Y
: 67556 67666 (view as bug list)
Depends on:
Blocks: 68331
  Show dependency tree
 
Reported: 2005-10-20 13:15 UTC by kovica
Modified: 2007-11-05 13:44 UTC (History)
6 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 kovica 2005-10-20 13:15:46 UTC
I'm using NetBeans IDE Dev (Build 200510171800) on Linux with java 1.5.0_05.

If I select a Java code in editor and press ALT-U U it should put the selected
text in upper case, but instead of this it replaces the selected text with small
letter u
Comment 1 kovica 2005-10-20 13:16:36 UTC
I've also tried ALT-U L and ALT-U R, but they don't work as expected and documented.
Comment 2 Roman Strobl 2005-10-24 12:38:19 UTC
Please fix it, it breaks tests.
Comment 3 Miloslav Metelka 2005-10-24 15:55:52 UTC
I have debugged pressing of "Alt-U U" and after MultiKeymap.shiftGlobalContext()
gets called correctly upon receiving of "Alt-U pressed" keystroke then
NbKeymap.resetContext() gets called for some reason from NbKeymap.getAction() on
line 125. Not sure why this happen but it effectively breaks down further
processing of the compound shortcut. Reassigning to Petr N. for evaluation.
Comment 4 Petr Nejedly 2005-10-24 16:29:10 UTC
I'll look at it but I suspect the NbKeymap shouldn't be called at all in this
case. Was the leading keystroke properly consumed?
I don'e even see the Alt+U context shift in the status bar.
Comment 5 Miloslav Metelka 2005-10-24 17:29:34 UTC
I'm not sure whether it gets consumed as it's a processing in the JEditorPane or
JTextComonent but I'll check that.
Regarding StatusDisplayer - it gets called properly in the MultiKeymap but the
NbKeymap.resetContext() gets called in succession so I suspect that you won't
see anything in the status bar.
Comment 6 Miloslav Metelka 2005-10-24 17:55:11 UTC
The "Alt-U pressed" KeyEvent gets consumed. The JComponent.processKeyBinding()
returns true which the JComponent.processKeyBindings() checks and consumes the
event.
Comment 7 Roman Strobl 2005-10-26 09:55:24 UTC
*** Issue 67556 has been marked as a duplicate of this issue. ***
Comment 8 Roman Strobl 2005-10-26 10:29:40 UTC
Marking this issue as future Q-Build stopper. It is a regression, breaks tests
and was reported by NetCAT as well. Do not fix it in current Q-Build branch, it
means that this issue needs should be fixed in trunk before we start testing of
next Q-Build (if not it will become a stopper of the next Q-Build).
Comment 9 Petr Nejedly 2005-10-26 13:00:10 UTC
I tried tracing code paths for Ctrl+J prefix and Alt+U prefix. Here are my findings:
For Alt+U, the context is set on KEY_PRESSED (by the editor's keymap)
 and immediatelly reset on KEY_TYPED (by the SAMKEP.postProcessKeyEvent/NbKeymap
 impl).
For Ctrl+J, this is not the case, KEY_TYPED is consumed in
JComponent.processKeyEvent, and thus is ignored in postProcess...
(Because SwingUtilities.isValidKeyEventForKeyBindings(e) returns true for
Ctrl-?, but false for Alt-?_

I'll try to fix in in NbKeymap.
Comment 10 Petr Nejedly 2005-10-26 15:47:48 UTC
core/windows/src/org/netbeans/core/windows/ShortcutAndMenuKeyEventProcessor.java,v1.16
Comment 11 ehartmann 2005-10-27 08:17:48 UTC
I confirm that with today build ALT-U U is now working!
Comment 12 Roman Strobl 2005-10-27 12:52:43 UTC
*** Issue 67666 has been marked as a duplicate of this issue. ***
Comment 13 Miloslav Metelka 2005-11-01 09:45:19 UTC
Unfortunately I have to reopen. Although "Alt-U U" works fine if you press any
of the modifier keys (Ctrl|Shift|Alt) after "Alt-U" the context gets reset
(again it gets to NbKeymap, line 125).
Comment 14 Miloslav Metelka 2005-11-01 16:45:40 UTC
Please also test switching to emacs profile and test "Alt-0 Ctrl-K" (cut to line
begining) and "Esc <" and "Esc >" (jump to file begin/end) whether those work.
Thanks.
Comment 15 ehartmann 2005-11-02 11:31:06 UTC
I've just tested with today build. Alt+0 Ctrl+K works fine to me. 

Esc < and Esc > are not working but I cannot find them in Keymap options (it's
really or to find the action of shortcuts). 

I've added Esc < (ESCAPE LESS) to match braces and actually this does not work.
I found that some shortcut does not work either (Ctrl+Alt+K for instance). So
you're right this bug has not been resolved.
Comment 16 Petr Nejedly 2005-11-08 16:25:06 UTC
This is very strange. I created a test shortcut Alt-U Ctrl-K and it works
perfectly, but if I try Alt-0, the context gets reset just after pressing Ctrl...
Comment 17 Petr Nejedly 2005-11-09 12:37:16 UTC
Added filtering of modifier-only events so they don't reset current context.
core/src/org/netbeans/core/NbKeymap.java,v1.28

There is still a problem with some keystrokes propagating into the editor as
typed text, e.g. if you bind "Esc _" (ESCAPE Shift+MINUS).
Comment 18 Petr Blaha 2005-11-09 15:00:09 UTC
The issue is Q-build 20051109/Beta2 stopper. All future stoppers should be
resolved in next Q-build otherwise are considered as stoppers.  
Comment 19 Petr Nejedly 2005-11-09 20:31:14 UTC
blaha: If I understand you correctly, you want me to integrate the fix also into
the beta2 branch, right?
Comment 20 Petr Blaha 2005-11-10 10:40:07 UTC
QE team member should verify the issue in trunk first and the you merge the fix
inrelease50_beta2 branch. Thanks  
Comment 21 Roman Strobl 2005-11-10 10:57:33 UTC
I'll take a look at it in trunk.
Comment 22 Miloslav Metelka 2005-11-10 11:43:30 UTC
Romane, could you please try to bind an action to "Esc _" as Petr was
complaining? I have tried to reproduce but it works fine for me on my FC3 both
on JDK1.4 and 1.5.
Thanks.
Comment 23 Roman Strobl 2005-11-10 11:50:43 UTC
Alt-U U works fine, Alt-O Ctrl-K works fine and Esc Shift-Minus works as well. I
tried few other shortcuts and they seem to work. Do you have any other suspicion
on shortcuts which may not work? Petre, does Esc Shift-Minus work for you now? I
am using build 20051110-0908.
Comment 24 Petr Blaha 2005-11-10 13:01:42 UTC
Romane, what's the status of this issue? If the issue is already verified, merge
ths fix in beta branch. Thanks
Comment 25 Roman Strobl 2005-11-10 13:42:19 UTC
It seems to be fixed to me but I am waiting for pnejedly to confirm that Esc - _
works for him now. Then we can commit it to branch.
Comment 26 Petr Nejedly 2005-11-10 15:53:36 UTC
"Esc _" works neither for me (on Linux) nor for Milan Kubec (on windows).
If you bind it to Edit->Undo, it correctly performs undo and then inserts "_"
Comment 27 Milan Kubec 2005-11-10 16:00:21 UTC
Whose turn is it now?
Comment 28 Roman Strobl 2005-11-10 16:10:10 UTC
My suggestion: Petr N. will commit the partial fix into the beta2 branch and we
will publish beta2 with the fact that Esc shortcuts do not work properly. Let's
file a separate issue for the Esc problem then.
Comment 29 Petr Nejedly 2005-11-10 17:10:36 UTC
Backported the fixinto the beta2 branch.
core/src/org/netbeans/core/NbKeymap.java,v1.27.6.1

Note: It's "_" binding (Shift+MINUS) that doesn't work, Esc prefix works OK.
Comment 30 Miloslav Metelka 2005-11-10 20:27:31 UTC
OK, closing as fixed.
BTW Petre/Milane could you pls specify JDK where it fails? Thanks.
Comment 31 Miloslav Metelka 2005-11-10 20:32:16 UTC
I have filed issue 68498 for the specific problem with "Esc _".
Comment 32 Milan Kubec 2005-11-11 08:28:27 UTC
I was running IDE on JDK 1.5.0_05.