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 61320 - The property sheet value cell shows non-commited value when repainted
Summary: The property sheet value cell shows non-commited value when repainted
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 4.x
Hardware: All All
: P4 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-23 00:22 UTC by _ sandipchitale
Modified: 2009-11-02 11:01 UTC (History)
1 user (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 _ sandipchitale 2005-07-23 00:22:50 UTC
To reproduce:

1. Create any Java Application Project
2. Create JPanel form
3. Add a JLabel
3. Open property sheet and select the JLabel's "foreground" property.
4. Click on "..." button to show the Color Chooser based custom editor panel 
dialog (supplied by the ColorEditor PropertyEdior).
5. Select different color (say red). The "foreground" property value cell in 
the property sheet still shows the original color. 
6. Now minimize NetBeans and restore it or in some way obscure and show 
the "foreground" property value cell in the property sheet.
7. Now the "foreground" property value cell in the property sheet shows the 
color selected in the Color Chooser based custom editor panel dialog which the 
user has not commited yet.

I think the reason for this is that the property sheet is implemented as a 
JTable and the property value cell is implemented as a cell renderer. The cell 
renderer paints itself whenever it is obscured and shown. In case of 
ColorEditor PropertyEditor the renderer delegates the painting to paintValue() 
method of PropertyEditor which has the uncommited value from Color Chooser. 
This only happens when the user somehow makes the property value cell to 
repaint and is misleading. Once the Color Chooser dialog is hidden (by click 
on Ok or Cancel button) the value in the property value cell does revert to 
the correct value.

I think the property sheet should cache the property value rather than the 
trasient value being edited. The value in the cell should be updated only when 
the user click OK. It could be considered a bug in the PropertyEditor - that 
it paints the transient value instead of property value.
Comment 1 _ sandipchitale 2005-07-23 00:27:18 UTC
Same problem occurs for "border", "font" and some other properties. I think 
the underlying reason is the same.
Comment 2 Stanislav Aubrecht 2005-10-19 10:52:39 UTC
this is a problem of the FormPropertyEditor in form designer module, not a
property sheet issue (e.g. package name property editor works fine)
Comment 3 Martin Krauskopf 2005-10-19 10:57:40 UTC
Thanks for evaluation Stando. "Finishing" reassigning.
Comment 4 Tomas Pavek 2005-10-21 17:53:23 UTC
I think it is not a problem of FormPropertyEditor (it just wraps the enclosed
property editor). You can see the same behavior when editing a color property
anywhere in the IDE, not just in form editor. It is not a problem of ColorEditor
either - it is just a lack of JavaBeans spec - the custom editor (visual
component) has no clue about the Ok/Cancel flow, it needs to set the value to
PropertyEditor whenever it is changed (e.g. a color selected).

A fix in property sheet might be to create another instance of property editor
for editing using custom editor. But I'm not sure if this would not cause some
other problems. Overall not sure if this bug is worth fixing...
Comment 5 Stanislav Aubrecht 2005-11-02 14:55:51 UTC
i agree with tpavek's evaluation. fixing this bug may break some other code that
depends on this behavior.

decreasing priority to P4
Comment 6 Stanislav Aubrecht 2008-11-21 09:06:37 UTC
a lot of changes in property sheet needed for this fix. imho not worth the effort
Comment 7 Quality Engineering 2009-11-02 11:01:28 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX