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]
I think this patch gives a simpler solution. I someone wants the options window to be modal he can use
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. The modal window needs to be different JDialog instance.
Created attachment 131822 [details]
Updated the patch based on Y01 comments. Also added a test. If there are no more objections I will integrate tomorrow. Thank you.
Author: Theofanis Oikonomou <email@example.com>
Date: 2013-02-26 11:27
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?
(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),
- open (-> modal or not?)
I will try it once the change is propagated to our team repo.
Integrated into 'main-golden', will be available in build *201302270948* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Theofanis Oikonomou <firstname.lastname@example.org>
Log: Issue #207120 - Allow options Dialog to be modal