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 118038 - [60cat]Undo key binding not working in Java Editor
Summary: [60cat]Undo key binding not working in Java Editor
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Key bindings (show other bugs)
Version: 6.x
Hardware: PC Linux
: P1 blocker with 8 votes (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
: 118877 120068 120918 120922 122712 122911 123090 123264 123622 126248 126820 130329 130883 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-07 12:37 UTC by algnod
Modified: 2008-04-07 12:39 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log file (24.06 KB, text/plain)
2007-10-08 14:24 UTC, algnod
Details
Ui Gestures file (35.91 KB, text/plain)
2007-10-08 14:26 UTC, algnod
Details
messages.log (40.34 KB, text/plain)
2007-12-07 08:30 UTC, tboerkel
Details
uigestures (805.83 KB, text/plain)
2007-12-07 08:32 UTC, tboerkel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description algnod 2007-10-07 12:37:38 UTC
Hello,

the key binding for undo does not work in the current nb 6.0 beta version.
Undo functionality does work if selected from the menu.

Thank you,
Alex
Comment 1 Jiri Prox 2007-10-08 09:28:37 UTC
What key map profile do you use? Has the Undo action assigned any shortcut?
Comment 2 algnod 2007-10-08 10:55:00 UTC
The key binding for undo is CTRL-Z
I have also tried it in the Ruby Only build with a css file and here the same key binding does not work
Comment 3 Vitezslav Stejskal 2007-10-08 11:30:41 UTC
I just tried this in a dev build with a few different files and it worked fine. Could you please describe the steps for
reproducing this issue? Thanks
Comment 4 algnod 2007-10-08 11:59:11 UTC
Unfortunately I can not give you much more information.
Maybe it is important to note that I am running NB 6.0 beta on Ubuntu 7.04 with:
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

1 I start NB
2 There is (for example) a text file open
3 I type a few characters at the cursors current position
4 I type CTRL-Z and nothing happens
5 I select Undo from the menu or I type Alt-E U and undo works
6 NEW: Something I have just found out: After performing the steps described above I immediately type CTRL-Z and it
works for EXACTLY ONE Undo. If I continue typing somewhere else and press Ctrl-Z nothing happens.

Let me know if you need more info. My guess is that this might be specific to the Linux version of NB?
Comment 5 Vitezslav Stejskal 2007-10-08 12:14:43 UTC
Thanks for the info. I'm also using ubuntu/gnome with usually jdk5. Could you please attach you
<userdir>/log/messages.log to see if there are any exceptions/warnings? Also, what set of modules are you using? Is it
standard beta1 or have you downloaded/installed some other plugins? Thanks
Comment 6 tboerkel 2007-10-08 12:22:34 UTC
I have a similar issue with Build 200710050000 on Windows Vista. The Undo keybinding works for a while (multiple times)
and then suddently stops working. After a restart of NB everything is back to normal.
Comment 7 algnod 2007-10-08 12:34:59 UTC
I downloaded the standard beta for java development with no extra plugins.
I am not sure where the log file you are asking for is located:
<userdir>/log/messages.log

Is the <userdir> my home/myname/ directory or is it the netbeans installation directory? In any case there is no
log/messages.log in either directory.
Comment 8 Vitezslav Stejskal 2007-10-08 13:30:48 UTC
Oh, I'm sorry, the log file is in your user directory, which is something like ${HOME}/.netbeans/6.0beta1 and there you
need to look for .../var/log/messages.log. The '6.0beta1' part is different for each milestone, release, etc and I am
not sure about the exact one for beta1, but I'm sure it's something obvious. Thanks
Comment 9 algnod 2007-10-08 14:24:50 UTC
Created attachment 50388 [details]
log file
Comment 10 algnod 2007-10-08 14:26:43 UTC
Created attachment 50389 [details]
Ui Gestures file
Comment 11 algnod 2007-10-08 14:38:50 UTC
I have attached the log file and also the uigestures file. It may be of interest, that in the uigestures file it reads
as far as i can tell:

<record>
  <date>2007-10-08T12:55:40</date>
  <millis>1191840940857</millis>
  <sequence>61</sequence>
  <logger>org.netbeans.ui.actions.editor</logger>
  <level>FINE</level>
  <thread>12</thread>
  <message>Invoking redo implemented as org.netbeans.modules.editor.NbEditorKit$
NbRedoAction@7d8dfb thru java.awt.event.ActionEvent[ACTION_PERFORMED,cmd=^Z,when=1191840940855,modifiers=Ctrl] 

INVOKING REDO action via ctrl-z

In a different spot it says:
<record>
  <date>2007-10-08T12:55:25</date>
  <millis>1191840925903</millis>
  <sequence>57</sequence>
  <logger>org.netbeans.ui.actions</logger>
  <level>FINER</level>
  <thread>12</thread>
  <message>Invoking &amp;Undo  implemented as org.openide.actions.U
ndoAction thru org.openide.awt.Actions$MenuItem</message>
  <key>UI_ACTION_BUTTON_PRESS</key>
  <catalog>org.openide.awt.Bundle</catalog>
  <param>org.openide.awt.Actions$MenuItem[Undo ]</param>
  <param>org.openide.awt.Actions$MenuItem</param>
  <param>org.openide.actions.UndoAction[&amp;Undo ]</param>
  <param>org.openide.actions.UndoAction</param>
  <param>&amp;Undo </param>
</record>
which says: INVOKING UNDO by selecting via the menu.

I do not know whether I am reading this correctly but to me ctrl-Z is linked to the redo action.
And in fact CTRL-Y does Undo und CTRL-Z is linked to redo. Somehow these two are mixed up in my system.
Comment 12 Vitezslav Stejskal 2007-10-09 10:18:12 UTC
That's interesting information. Thanks for spotting this.
Comment 13 Vitezslav Stejskal 2007-10-16 09:16:06 UTC
*** Issue 118877 has been marked as a duplicate of this issue. ***
Comment 14 Jiri Prox 2007-10-25 17:18:24 UTC
*** Issue 120068 has been marked as a duplicate of this issue. ***
Comment 15 grimlock81 2007-10-27 08:21:06 UTC
I had this same problem. I went to the key mappings section, checked that the mapping was Ctrl-Z, pressed OK to exit 
out of the dialog and Ctrl-Z worked from that point on.
Comment 16 rogier 2007-10-31 18:49:52 UTC
I'm using Beta 2 on Windows XP and I'm experiencing the same problems, no help when checking the key binding in the
Options menu
Comment 17 Jiri Prox 2007-11-02 09:06:39 UTC
*** Issue 120918 has been marked as a duplicate of this issue. ***
Comment 18 Jiri Prox 2007-11-02 09:06:54 UTC
*** Issue 120918 has been marked as a duplicate of this issue. ***
Comment 19 Jiri Prox 2007-11-02 09:07:50 UTC
*** Issue 120922 has been marked as a duplicate of this issue. ***
Comment 20 Jiri Prox 2007-11-26 14:23:08 UTC
*** Issue 122712 has been marked as a duplicate of this issue. ***
Comment 21 Jiri Prox 2007-11-29 07:28:23 UTC
*** Issue 122911 has been marked as a duplicate of this issue. ***
Comment 22 Vitezslav Stejskal 2007-11-30 12:21:36 UTC
*** Issue 123090 has been marked as a duplicate of this issue. ***
Comment 23 Jiri Prox 2007-12-04 08:16:13 UTC
*** Issue 123264 has been marked as a duplicate of this issue. ***
Comment 24 tboerkel 2007-12-07 08:30:29 UTC
This just happened to me with NB 6.0 release and WinXP. Undo was working, but suddenly stopped working. After restart of
NB, everything is OK again.

Since this is pretty annoying and making NB look unprofessionell, this should be P2.

Attaching messages.log and uigestures.
Comment 25 tboerkel 2007-12-07 08:30:59 UTC
Created attachment 53975 [details]
messages.log
Comment 26 tboerkel 2007-12-07 08:32:04 UTC
Created attachment 53976 [details]
uigestures
Comment 27 Jan Lahoda 2007-12-07 10:44:31 UTC
*** Issue 123622 has been marked as a duplicate of this issue. ***
Comment 28 Vitezslav Stejskal 2007-12-07 11:14:48 UTC
Thanks tboerkel, I increased the prio. It happened to me the other day too and I spent about an hour trying to track it
down, but with no luck. Anyway, it's pretty annoying when it happens.
Comment 29 Jiri Prox 2007-12-07 11:39:19 UTC
*** Issue 123622 has been marked as a duplicate of this issue. ***
Comment 30 Michel Graciano 2007-12-07 13:03:08 UTC
I think the target milestone need to be updated too. I hope this can be fixed to 6.0.1!

Cheers.
Comment 31 Vitezslav Stejskal 2007-12-11 09:18:17 UTC
AFAIK there is not going to be anything like 6.0.1. The next release is 6.1, so the best shot we can do is for 6.1M1.
But don't worry it's still pretty soon - http://wiki.netbeans.org/wiki/view/NB61Milestones. The flip side is that we
still don't know what the problem is exactly. :-(
Comment 32 swpalmer 2008-01-11 01:57:58 UTC
I thought I added these comments already, but I don't see them here, so...

Every time I have noticed this happen it is when I am undoing an edit that happened by accidentally doing a
drag-and-drop edit while trying to adjust the range of the current selection.  But that alone doesn't seem to be the
issue because I can't reproduce it by doing just that.
Comment 33 Jan Becicka 2008-02-01 16:23:43 UTC
Vito, please take a look at it. Many duplicates. 6 votes.
Comment 34 Vitezslav Stejskal 2008-02-06 13:02:21 UTC
*** Issue 126820 has been marked as a duplicate of this issue. ***
Comment 35 Jana Maleckova 2008-02-07 14:36:20 UTC
*** Issue 126248 has been marked as a duplicate of this issue. ***
Comment 36 Max Sauer 2008-03-18 09:24:24 UTC
*** Issue 130329 has been marked as a duplicate of this issue. ***
Comment 37 Jiri Prox 2008-03-25 08:54:17 UTC
*** Issue 130883 has been marked as a duplicate of this issue. ***
Comment 38 swpalmer 2008-03-28 22:47:50 UTC
I have noticed that when this happens the CTRL-Z binding still works in the GUI editor (Matisse)
Comment 39 tboerkel 2008-03-29 09:43:30 UTC
This will not be fixed in 6.1??? This is one of the most annoying things in 6.0!!!
Comment 40 swpalmer 2008-03-29 12:28:53 UTC
I agree.  It is ridiculous that this hasn't been addressed by now.  To release 6.1 knowing that this show stopper is still there is foolish.
Comment 41 Vitezslav Stejskal 2008-03-30 10:44:33 UTC
Well, maybe it is one of the most annoying things in Nb 6.0 and maybe we are fools. But the fact is that we have no
reliable steps for reproducing this issue and even after considerable time spent on analysis we don't know what is
causing this problem and don't have a fix for it. So, instead of delaying the release for unknown amount of time until
this issue is resolved, we decided to take the risk of looking foolish and waved this issue. This does not mean we have
given up and stopped looking for the solution. It's still a P2 and very high on our list. I'd like to assure you that as
soon as the fix is known we will push it to users through the AU servers. In the meantime if any of you knows how to
reliably reproduce it, please post the steps here. Thank you
Comment 42 tboerkel 2008-03-31 13:01:54 UTC
If there are no steps to reproduce, maybe there is something we can do or check after it has happened?
Comment 43 wozzat 2008-04-01 12:23:26 UTC
I think I can reproduce this:

Create or open a GUI project.
Verify that the keybinding works: open the java editor type some nonsense and press Ctrl+Z.
Switch to design view (mattise)
Select an existing, or add a new, swing control.
View the properties.
Click on the code button (at the top of properties).
Then click any of the more (...) buttons, for example 'Pre-Init code.
Switch back to source view.
Ctrl+Z no long works for me.

I'm using:

Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)

Comment 44 algnod 2008-04-01 12:31:53 UTC
I can confirm wozzats way of reproducing the bug on Ubuntu 7/10 with Netbeans dev 200803251204
alex
Comment 45 Marian Mirilovic 2008-04-01 12:42:49 UTC
wozzat - thank you very much !

I can confirm it as well in :
Product Version: NetBeans IDE Dev (Build 200803311426)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 10.0-b19
System: Linux version 2.6.22-14-generic running on amd64; UTF-8; en_US (nb)
Comment 46 Jiri Prox 2008-04-01 12:44:03 UTC
The testcase is reproducible. Thanks wozzat.


Product Version: NetBeans IDE Dev (Build 200803311211)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)
Comment 47 jgawera 2008-04-01 13:42:04 UTC
I can also reproduce this.
Product Version: NetBeans IDE 6.0.1 (Build 200801291616)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
Comment 48 jgawera 2008-04-01 13:42:27 UTC
I can also reproduce this.
Product Version: NetBeans IDE 6.0.1 (Build 200801291616)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
Comment 49 Miloslav Metelka 2008-04-01 16:20:25 UTC
I was able to reproduce and I will attempt to fix this.
Comment 50 Miloslav Metelka 2008-04-02 14:00:58 UTC
I've found what's wrong and I'm working on a fix.
Comment 51 Miloslav Metelka 2008-04-02 17:32:56 UTC
The code in form editor's FormUtils which sets an undo manager and undo/redo keybindings was disabled. It did not
restore the state of the editor component's keymap and since the keymap instance was shared among the editors this
problem arised.
Editor now manages its own default undo manager in case when it's not added into a TopComponent so the functionality in
FormUtils is no longer needed.
A nice side effect is that the undo/redo should now also work in other editor panes embedded in dialogs e.g. in
debugger's Evaluate Expression dialog.

http://hg.netbeans.org/main/rev/4a5981146d70

IMHO it would be good to have this fix in 6.1 if it proves to be OK. What's the QE's opinion?
Comment 52 dustin_mccartney 2008-04-02 22:18:21 UTC
Congratulations on finding and fixing this issue!  I will test this in the next nightly build!

Thank you for your efforts!
Comment 53 swpalmer 2008-04-03 02:30:32 UTC
+1 for getting this fix into 6.1. (And thanks to wozzat for finding how to reproduce this.)
Comment 54 Marian Mirilovic 2008-04-03 09:56:09 UTC
I agree with integration to 6.1. Mila, proceed with integration please. Thanks in advance.
Comment 55 Vitezslav Stejskal 2008-04-03 10:41:27 UTC
The change looks ok to me, so please consider it peer reviewed. Thanks Mila
Comment 56 Jiri Prox 2008-04-03 10:51:12 UTC
it seems to be ok -> verified from QA
Comment 57 Miloslav Metelka 2008-04-03 14:33:57 UTC
Integrated in release61:
http://hg.netbeans.org/main/rev/cf1422dd7db1
Comment 58 gcruscoe 2008-04-03 20:15:49 UTC
Is there anyway to release this fix for the current 6.0.1 release?  I think its great that its going into 6.1, but until
I can get the office to update all of the developers to 6.1 I understand that there are issues with mixing and matching
6.0.1 and 6.1 for the same project (integrated with svn for instance).

Is there any way to have a netbeans update (using the plugins tool for instance) for this?

Thanks so much.
Comment 59 Jan Becicka 2008-04-04 07:52:05 UTC
ccing pgebauer.
Comment 60 Jiri Prox 2008-04-04 08:37:02 UTC
verified in 6.1
Comment 61 Vitezslav Stejskal 2008-04-07 11:51:14 UTC
This could help to mitigate the issue for some people on older versions. The problem was caused by code customizers in
the form editor (Matisse). So, as long as you don't use Matisse or don't use any of its code customizers (ie. dialogs
that allow entering code like those for pre-init, post-init, etc) this issue should not harm you.

Maybe we could also push the change through the autoupdate servers somehow, so that anybody running 6.0, 6.0.1 could
simply update its IDE.
Comment 62 aldobrucale 2008-04-07 12:10:08 UTC
That would surely improve your karma.
Comment 63 pgebauer 2008-04-07 12:39:54 UTC
gcruscoe wrote:
> Is there anyway to release this fix for the current 6.0.1 release?
> Is there any way to have a netbeans update (using the plugins tool for instance) for this?

Thank you for your interest in this NetBeans issue; its fix is available
in the latest daily builds and will be part of the NetBeans 6.1 IDE
release. At this time our proactive patches for the NetBeans 6.0.1 IDE
have concluded as we shift our focus to preparing for 6.1 proactive
patches.

If you own a Sun service plan contract for NetBeans, you may wish to
contact Sun Service http://www.sun.com/contact/support.jsp to obtain 
the fix via product defect escalation process.

For more information on purchasing a Sun service plan contract for
NetBeans, refer to the two service plan items in the Sun Service table
found on our NetBeans Support Resources page
http://www.netbeans.org/kb/support.html