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 22258 - DataObject.rename causes property sheet to disappear
Summary: DataObject.rename causes property sheet to disappear
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: All Solaris
: P2 blocker (vote)
Assignee: phamernik
URL:
Keywords:
Depends on: 20699
Blocks:
  Show dependency tree
 
Reported: 2002-04-09 20:46 UTC by Chris Webster
Modified: 2008-12-23 12:20 UTC (History)
3 users (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 Chris Webster 2002-04-09 20:46:25 UTC
Try the following test:
1. create java class
2. go to property sheet
3. change name 
notice that the property sheet will disappear.
JavaNode.createSheet invokes super.createSheet()
which adds a read/write property that invoked
obj.rename when the setValue method is invoked,
this invocation causes the property sheet to
disappear.
Comment 1 Petr Hrebejk 2002-04-10 13:57:04 UTC
It looks like the problem is that the selection is not retained after 
the node rename. It applyies to all nodes not only to JavaNodes.
I'm going to investigate it more.
Comment 2 Petr Hrebejk 2002-04-10 15:18:29 UTC
It seems that this bug only affects DataNodes. (Renaming another
nodes e.g. JavaMethods is OK). 

It looks like the problem is that the DataNode first fires
PropertyChange of it's parent from the parent to null. After this the 
PropertyChange of the name is fired. This probably causes the
selection loss. 

The parent property change seems to be result of the run of
FolderChilderen$Addition
Comment 3 phamernik 2002-04-11 09:19:19 UTC
I am taking this issue.
Comment 4 Chris Webster 2002-04-11 17:46:44 UTC
This is a regression and as such I think this should be included in NB
3.3.2. 
Comment 5 phamernik 2002-04-12 14:19:03 UTC
Fixed in trunk:
org.openide.loaders.DataObject revision 1.71

Diff:
http://www.netbeans.org/source/browse/openide/src/org/openide/loaders/DataObject.java.diff?r1=1.70&r2=1.71&f=H
Comment 6 Jesse Glick 2002-04-12 15:04:16 UTC
FWIW (1) the regression was caused by my fix of issue #20699; (2) I
approve of the fix - it would have been desirable anyway, as the
#20699 patch just exposed an existing bug.

The #20699 patch caused the data node to be recreated whenever the
primary file of a data object changed or the data object was recreated
(even if the type of data object did not change) - however until the
patch for #22258, the primary file was signalled as having changed
after a simple (in-folder) rename, when in fact the primary file does
not change identity in this situation.

Petr I suggest a unit test: rename a simple DataObject and confirm
that PROP_PRIMARY_FILE is *not* fired.
Comment 7 Marian Mirilovic 2002-04-17 13:09:41 UTC
verified in [orion CE](020416_1) & [nb_dev](20020417)
Comment 8 Quality Engineering 2003-07-01 16:12:52 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.