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 94605 - Undo doesn't undo properly
Summary: Undo doesn't undo properly
Status: VERIFIED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 85259 (view as bug list)
Depends on:
Blocks: 136425
  Show dependency tree
 
Reported: 2007-02-06 11:35 UTC by ahristov
Modified: 2011-10-04 09:42 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Testcase - form file (6.69 KB, application/octet-stream)
2007-02-06 11:36 UTC, ahristov
Details
Testcase - java file (6.18 KB, text/plain)
2007-02-06 11:37 UTC, ahristov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ahristov 2007-02-06 11:35:35 UTC
In many many occasions undo fails to undo properly to the previous state,
leaving resized or repositioned components.

I've managed to catch one such occasion, shrink it to a minimum and I'm
enclosing it as a test case.

To reproduce: pick the white panel, drag it and place it BETWEEN the green and
black panels (not *inside* any of them, just between them). For whatever reason,
the layout manager decides that it should resize the existing panels. This is an
issue, but it maybe because I just don't know what dependancies are there. The
real issue is that after this operation, no amount of "undo"ing reverts to the
initial state - the panels stay resized vertically.
Comment 1 ahristov 2007-02-06 11:36:15 UTC
Created attachment 38094 [details]
Testcase - form file
Comment 2 ahristov 2007-02-06 11:37:02 UTC
Created attachment 38095 [details]
Testcase - java file
Comment 3 Tomas Pavek 2007-02-08 09:47:11 UTC
If I move the white panel in between it's all fine (see no vertical resize). 
However, if I move it into the black one, the panels grow vertically, and this 
vertical size is not changed back with undo.

Looking at the layout properties in property sheet, all the panels have the 
Vertical Resizable property set to true. (Though the vertical arrow in the 
toolbar does not indicate the resizability - this is a known problem.) If I 
uncheck Vertical Resizable, then unod works fine.

Thanks for finding the test case.
Comment 4 rgoodwin 2008-04-30 10:10:56 UTC
I also experienced this undo problem with NetBeans 5.5, which I used for six months to develop a complex Swing
management UI. I have also seen this bug with NetBeans 6 a few times, so decided to comment as the problem obviously is
not fixed yet.

Typically the undo problem happens in conjunction with an unexpected/unwanted JFrame or JPanel resize by the free design
layout manager. 
Usually the JFrame will be complex and contain many JPanel and sub JPanel and components.
And when I try to move or resize a component like a JTextField, the NetBeans free design layout manager decides to
perform a resize on top level JFrame or JPanel components!!
Sometimes a sub-panel will be widened or deepened for no reason, or worse still the whole frame will be widened !! 

Why does the layout manager do this ?? I want the top level JFrame and JPanel to keep their exact size.
And often the undo will fail to restore the frame or panel to their previous size.

This problem doesn't usually happen on a simple JFrame with less than a dozen components.
Maybe this is why you guys can't seem to find and fix this, because your diagnostic test cases are too simple.
But hey, real world projects require forms with many components.

On one occasion I accidentally ran the project immediately after the undo. 
This unfortunately resulted in the corrupted JFrame and .form file being saved (prior to compilation and execution). 
So I had to revert back to previous versions from our Subversion repository, ruining two hours work !!
Comment 5 Tomas Pavek 2010-08-20 12:20:12 UTC
The cause why undo does not restore vertical size is that after undo the designer does not update (rebuild) the layout of the panels that only changed in size but not in content. In this case it is the size of the vertical filling gap in the green panel. The enclosing panel (pnlButtons) is set as fixed, so without updating the contained sub-panels it cannot shrink.

It's basically the same problem as in bug 85259.
Comment 6 Tomas Pavek 2010-08-20 12:20:45 UTC
*** Bug 85259 has been marked as a duplicate of this bug. ***
Comment 7 asenk 2011-10-04 09:41:48 UTC
Fixed in 7.1 - Free Design improvements
Comment 8 asenk 2011-10-04 09:42:37 UTC
Product Version: NetBeans IDE Dev (Build 201110030601)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Linux version 2.6.38-11-generic running on i386; UTF-8; en_US (nb)