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.
NotifyDescriptor is constructed with default value. This value is not direct accessible in NotifyDescriptor. ND returns it from ND.getValue() till a dialog based on this descriptor is shown and an user invokes some of dialog's option. The some of options is invoked then ND.getValue() returns the pressed option. The defaultValue is not accessible since then. DialogDisplayer uses the defaultValue for layouting the dialog and sets the defaultValue as default capable button. It's broken when same instance of NotifyDescriptor is used for more dialogs. Trouble issue 56534 depends on this.
Added the demonstrate this problem. RCS file: /cvs/openide/test/unit/src/org/openide/NotifyDescriptorTest.java,v done Checking in unit/src/org/openide/NotifyDescriptorTest.java; /cvs/openide/test/unit/src/org/openide/NotifyDescriptorTest.java,v <-- NotifyDescriptorTest.java initial revision: 1.1 done
Created attachment 21070 [details] proposed patch
I would like to add new method getDefaultValue() in NotifiDescriptor. The NotifyDescriptor.getDefaultValue() returns object which represents the default value. This default value is introduced in the constructor of NotifyDescriptor but not accessible by any method. The attached patch contains the proposed addition and makes all corresponding tests passing. Thanks for review. I'm going to integrate in trunk sometime next week before HR.
I'm going to integrate today.
Checking in openide/openide-spec-vers.properties; /cvs/openide/openide-spec-vers.properties,v <-- openide-spec-vers.properties new revision: 1.170; previous revision: 1.169 done Checking in openide/api/doc/changes/apichanges.xml; /cvs/openide/api/doc/changes/apichanges.xml,v <-- apichanges.xml new revision: 1.239; previous revision: 1.238 done Checking in openide/src/org/openide/NotifyDescriptor.java; /cvs/openide/src/org/openide/NotifyDescriptor.java,v <-- NotifyDescriptor.java new revision: 1.46; previous revision: 1.45 done Checking in openide/test/unit/src/org/openide/NotifyDescriptorTest.java; /cvs/openide/test/unit/src/org/openide/NotifyDescriptorTest.java,v <-- NotifyDescriptorTest.java new revision: 1.4; previous revision: 1.3 done
Verified.