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 56878

Summary: No way to acquire the defaultValue in NotifyDescriptor
Product: platform Reporter: Jiri Rechtacek <jrechtacek>
Component: Dialogs&WizardsAssignee: Jiri Rechtacek <jrechtacek>
Status: CLOSED FIXED    
Severity: blocker Keywords: API, API_REVIEW_FAST
Priority: P3    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 56534    
Attachments: proposed patch

Description Jiri Rechtacek 2005-03-23 15:33:14 UTC
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.
Comment 1 Jiri Rechtacek 2005-03-23 15:37:23 UTC
Added the demonstrate this problem.

RCS file: /cvs/openide/test/unit/src/org/openide/,v
Checking in unit/src/org/openide/;
/cvs/openide/test/unit/src/org/openide/,v  <--
initial revision: 1.1
Comment 2 Jiri Rechtacek 2005-03-23 16:03:22 UTC
Created attachment 21070 [details]
proposed patch
Comment 3 Jiri Rechtacek 2005-03-23 16:08:39 UTC
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.
Comment 4 Jiri Rechtacek 2005-03-30 08:52:46 UTC
I'm going to integrate today.
Comment 5 Jiri Rechtacek 2005-03-30 11:21:41 UTC
Checking in openide/;
/cvs/openide/,v  <--
new revision: 1.170; previous revision: 1.169
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
Checking in openide/src/org/openide/;
/cvs/openide/src/org/openide/,v  <--
new revision: 1.46; previous revision: 1.45
Checking in openide/test/unit/src/org/openide/;
/cvs/openide/test/unit/src/org/openide/,v  <--
new revision: 1.4; previous revision: 1.3
Comment 6 Jaromir Uhrik 2005-07-14 16:18:45 UTC