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 - No way to acquire the defaultValue in NotifyDescriptor
Summary: No way to acquire the defaultValue in NotifyDescriptor
Alias: None
Product: platform
Classification: Unclassified
Component: Dialogs&Wizards (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
Depends on:
Blocks: 56534
  Show dependency tree
Reported: 2005-03-23 15:33 UTC by Jiri Rechtacek
Modified: 2008-12-22 18:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

proposed patch (2.64 KB, patch)
2005-03-23 16:03 UTC, Jiri Rechtacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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