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 226292 - Form editor looses group layout default size setting.
Summary: Form editor looses group layout default size setting.
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.3
Hardware: Other Other
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-18 19:49 UTC by schulte2004
Modified: 2013-07-02 02:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example dialog source code. (2.70 KB, text/x-java-source)
2013-02-18 19:50 UTC, schulte2004
Details
Example dialog XML form file. (3.94 KB, application/octet-stream)
2013-02-18 19:51 UTC, schulte2004
Details
TabbedPaneDialog example source code. (3.34 KB, text/x-java-source)
2013-02-18 20:56 UTC, schulte2004
Details
TabbedPaneDialog example form file. (5.78 KB, application/octet-stream)
2013-02-18 20:57 UTC, schulte2004
Details

Note You need to log in before you can comment on or make changes to this bug.
Description schulte2004 2013-02-18 19:49:00 UTC
Product Version: NetBeans IDE 7.3 RC2 (Build 201302050851)
Java: 1.7.0_11; OpenJDK Server VM 23.6-b04
Runtime: OpenJDK Runtime Environment 1.7.0_11-b24

Please see the attached example dialog.

1. Verify the XML form file does not contain any 'pref=' XML attributes.
2. Open the dialog with the GUI builder.
3. Inspect the "Layout" properties of the "scrollPane" component. They should read:

     Horizontal Size: Default
     Vertical Size: Default
     Horizontal Resizable: checked
     Vertical Resizable: checked

On my system the Vertical Size property has been set to a fixed value during opening the form. Saving the form, this fixed value will be written to the XML form file (by adding a pref="that value" attribute). I need to manually reset the Vertical Size layout property of the "scollPane" component to "Default" after opening the form with the GUI builder. Removing the "model" of the "table" component ("Reset to Default"), the Vertical Size layout property of the "scrollPane" component no longer changes silently.
Comment 1 schulte2004 2013-02-18 19:50:36 UTC
Created attachment 131543 [details]
Example dialog source code.
Comment 2 schulte2004 2013-02-18 19:51:24 UTC
Created attachment 131544 [details]
Example dialog XML form file.
Comment 3 schulte2004 2013-02-18 20:55:30 UTC
TabbedPaneDialog example:

1. Verify the XML form file does not contain any 'pref=' XML attributes.
2. Open the TabbedPaneDialog with the GUI builder.
3. Inspect the "Layout" properties of the "tabbedPane", "textField1" and "textField2" components. They should all read:

     Horizontal Size: Default
     Vertical Size: Default
     Horizontal Resizable: checked
     Vertical Resizable: checked

On my system some properties will have been set to fixed values during opening the form. Saving the form, those values will be written to the XML form file (by adding pref= attributes).
Comment 4 schulte2004 2013-02-18 20:56:48 UTC
Created attachment 131546 [details]
TabbedPaneDialog example source code.
Comment 5 schulte2004 2013-02-18 20:57:08 UTC
Created attachment 131547 [details]
TabbedPaneDialog example form file.
Comment 6 Tomas Pavek 2013-07-01 13:13:06 UTC
Thanks for the provided test cases. They show some specific quirks in real layout computation with JTabbedPane or JTable involved - which lead to some components ending up with different actual size than is their provided preferred size (e.g. the height of the table in the first example appears smaller than its preferred height, OTOH the height of the textfields in tabbed pane from the second example is bigger). The GUI builder then thinks it should update the defined size to match the actual size and cancels the defaults. But in this case (if such an layout was created from default size settings) it obviously should not.

Implemented some more logic to better decide when to update the defined sizes. Also managed to workaround the wrong first size computation for the scroll pane with JTable demonstrated in the first example. Added some workaround for JEditorPane (related to bug 231636).

http://hg.netbeans.org/jet-main/rev/91c8562b5aa7
Comment 7 Quality Engineering 2013-07-02 02:14:41 UTC
Integrated into 'main-silver', will be available in build *201307012300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/91c8562b5aa7
User: Tomas Pavek <tpavek@netbeans.org>
Log: #226292, #231636: improving how size definition is preserved without unnecessary changes