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 66433 - [50cat] can't UNDO immediately
Summary: [50cat] can't UNDO immediately
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-11 04:41 UTC by rrochat
Modified: 2005-11-04 15:32 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 rrochat 2005-10-11 04:41:29 UTC
[ BUILD # : 1st beta ]
[ JDK VERSION : 1.5.0_05 ]

Following the steps from the tutorial (http://www.netbeans.org/kb/50/quickstart-gui.html):
2. Move the cursor over the Title: and Nickname: JLabels on the second row such that the JTextField overlaps both and is aligned to their baselines...

3. Click to place the JTextField between the Title: and Nickname: JLabels.

I didn't like the placement, so I tried to Undo, only it wasn't enabled.  I had to select the panel before I could Undo.  I think Undo should be enabled immediately after any undoable action.
Comment 1 Jan Stola 2005-10-13 13:03:16 UTC
I am sorry I am not able to reproduce the issue. Are you still able
to reproduce it? If so, are you able to reproduce it only in this case
or are there some actions (addition/removal of a component, resizing etc.)
that always make Undo disabled?
Comment 2 rrochat 2005-10-13 21:20:15 UTC
Now that I experiement with it more, it's tricky.  It is readily reproducible,
although I am not able to give you a definitive set of steps.  What seems to
work one time doesn't the next.
Here's what I used to reproduce it several times in a row:
1. Open a new JPanel
2. Place 2 JLabels on it next to each other.
3. Left click on the JPanel to unselect the labels.
4. Left click a JCheckBox on the Palette, then left click between the two JLabels.

But I can't get that to work any more.
A better series of steps might be:

1. Place a bunch of labels in a row.
2. Try adding checkboxes between each one and test for undo after each drop with
 alt-e to see if Undo is enabled.  Sometimes it will be on the 1st try;
sometimes on the 3rd; sometimes not til the 10th.

In experimenting more with this, I got the following.  I see that there are a
lot reported and fixed since the beta1, but don't know when since the website is
so abysmally slow today (sorry, I don't have hours to sort through each one).  I
doubt that it's related, but in case it has any bearing at all, here's the top
of it:
java.lang.IndexOutOfBoundsException: Index: 5, Size: 4
	at java.util.LinkedList.entry(LinkedList.java:368)
	at java.util.LinkedList.get(LinkedList.java:313)
	at
org.netbeans.modules.form.layoutdesign.LayoutInterval.getSubInterval(LayoutInterval.java:409)
	at
org.netbeans.modules.form.layoutdesign.LayoutFeeder.accommodateSizeInSequence(LayoutFeeder.java:1281)
	at
org.netbeans.modules.form.layoutdesign.LayoutFeeder.accommodateOutPosition(LayoutFeeder.java:1227)
	at
org.netbeans.modules.form.layoutdesign.LayoutFeeder.addInterval(LayoutFeeder.java:712)
	at org.netbeans.modules.form.layoutdesign.LayoutFeeder.add(LayoutFeeder.java:264)
	at
org.netbeans.modules.form.layoutdesign.LayoutDesigner.endMoving(LayoutDesigner.java:478)
	at
org.netbeans.modules.form.HandleLayer$NewComponentDrag.end(HandleLayer.java:2452)
	at
org.netbeans.modules.form.HandleLayer$NewComponentDropListener.drop(HandleLayer.java:2590)
	at java.awt.dnd.DropTarget.drop(DropTarget.java:430)
	at
sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500)
	at
sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:53)
	at
sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:812)
	at
sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:736)
Comment 3 Jan Stola 2005-10-14 09:52:06 UTC
I am sorry I am still not able to reproduce it. Could you, please, check
that the form window is activated (e.g. its title is highlighted) when
the problem occurs.
Comment 4 rrochat 2005-10-14 19:11:20 UTC
Yes, the form title tab is not highlighted when Undo is not enabled!  
Today I'm using the Oct 13 QBuild and I can readily reproduce if I *DRAG* a new
Palette item and drop it on the form.
I didn't think I was dragging before, but maybe I was.
The Palette title bar is highlighted even after I release the button when
dropping an item on the form.  I think this should make the form the active
window; I thought it was because of the orange and blue markers.

Dragging is a common idiom to use in this situation (it's apparently too
automatic for me to even notice that I'm doing it); please don't fix this by
disallowing dragging.

Thanks for your persistence in identifying the problem.
Comment 5 Jan Stola 2005-10-17 09:16:54 UTC
Thank you for the additional information. Now I am able to reproduce
the problem - the form designer is not activated after drag and drop.
Comment 6 Jan Stola 2005-11-04 15:32:22 UTC
Fixed.

/cvs/form/src/org/netbeans/modules/form/HandleLayer.java,v
new revision: 1.127; previous revision: 1.126