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.
I'm having trouble with PropertySheetView.setNodes. We have property sheets that are dynamically created and they often display empty. Our code follows the following pattern: PropertySheetView propertySheetView = new PropertySheetView(); propertySheetView.setNodes(nodes); //try {Thread.currentThread().sleep(200);}catch(Exception e){;}; JPanel panel = new JPanel(); panel.add(propertySheetView); panel.add(new JLabel("yes, this is the correct panel...")); Display panel... If I enable the sleep in the code, the properties display fine. See attached code for more details. I believe the problem I'm having is due to the asynchronous nature of setNodes. setNodes ads the node asynchronously after a delay of 70ms (why 70ms?) but returns immediately. And I cannot find a way to check when the panel is actually ready to display. Questions: Am I correct my evaluation? Is the sleep work-around a reasonable work-around? Is there a better work-around I can implement and avoid the hard-coded sleep.
Created attachment 50755 [details] test code
See also http://www.netbeans.org/issues/show_bug.cgi?id=105525 Project Properties doesn't work with NB6.0
Passing to property sheet owner...
simply use PropertySheet instead of PropertySheetView - i've tried it on your test code and it works fine
Thanks Stando.
It seems to work, thanks. But can you explain why it is better to use PropertySheet? It seems to be calling the same setNodes().
propertysheetview uses explorermanager to manage its nodes (i think)
"Debug Executable" dialog in sunstudio has similar codes as cnd/project property This issue is not revealed in 6.0 but come back again in 6.1, I'm using PropertySheet instead of PropertySheetView, even if I increase sleep up to 1.2 seconds, situation does not get better.
I compared source of src/org/openide/explorer/propertysheet/PropertySheet.java of NB6.0 and NB6.1, there are some changes in NB6.1 related to how helperNodes was updated, which I think cause this regression. Because this is a regression of NB6.0, I wish it can be fixed in NB6.1 patch, raised Priority to P1.
i can't reproduce this issue in the latest release61 clone. when i use the sample code provided by thp, switch to PropertySheet instead of PropertySheetView then it's all working fine, no timeout is needed. when a PropertySheetView is used then no properties are displayed because ExplorerManager manages the nodes to be displayed then. please provide a reproducible test case and/or file a new issue