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.
Created attachment 114764 [details] Modal Options Displayer Patch When writing non-GUI NetBeans platform applications the current implementation of the OptionsDisplayer does not allow the Options Dialog to be displayed in a modal manner. This behavior is fine for GUI applications, but does not work for console applications, were you often want to wait for the window to close before continuing. I've created a patch that overloads OptionsDisplayer.open() and OptionsDisplayer.open(String path) with a boolean waitUntilClosed parameter. The patch also makes some associated changes in OptionsDisplayerImpl in order to use the boolean waituntilClosed parameter. Most notably it removes the boolean 'modal' class field as it is no longer used. I've checked that normal functioning of the NetBeans IDE is not affected (IE the options dialog still pops up as it should) and that it produces the desired effect when the waituntilClosed parameter is set to true (the options dialog becomes modal)
Created attachment 131578 [details] a patch I think this patch gives a simpler solution. I someone wants the options window to be modal he can use OptionsDisplayer.getDefault().setIsModal(true); OptionsDisplayer.getDefault().open(); The default behaviour is for the options window to be non-modal.
The proposed patch allows for a user to set the options window in a modal mode. Please review. Thank you
Y01 Setters don't belong to singletons[1]. The modal window needs to be different JDialog instance. [1] http://wiki.apidesign.org/wiki/Singleton
Created attachment 131822 [details] proposed patch Updated the patch based on Y01 comments. Also added a test. If there are no more objections I will integrate tomorrow. Thank you.
Changeset: d6e7d2e46060 Author: Theofanis Oikonomou <theofanis@netbeans.org> Date: 2013-02-26 11:27 Message:
Perhaps I am wrong but I miss setModal(false) for the original open() methods - if one opens modal Options dialog and then calls just open(), would the Options dialog be non-modal? Thanks.
(In reply to comment #6) > if one opens modal Options dialog and then calls just open(), would the Options > dialog be non-modal? if you use open(true) and then at some point open() or whatever for that matter the dialog would remain modal. Once the dialog is opened the modality is set until the dialog closes.
(In reply to comment #7) > if you use open(true) and then at some point open() or whatever for that matter > the dialog would remain modal. Once the dialog is opened the modality is set > until the dialog closes. OK, I meant: - set modal - open (-> modal), - close - open (-> modal or not?) I will try it once the change is propagated to our team repo. Thanks.
Integrated into 'main-golden', will be available in build *201302270948* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/d6e7d2e46060 User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Issue #207120 - Allow options Dialog to be modal