DialogDescriptor close option

View: New views
5 Messages — Rating Filter:   Alert me  

DialogDescriptor close option

by creusar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Searching the forums i've managed to discover how to listen to the property change on the closing event (close button on dialog). There are some posts on the closing option of top components too...



What i realy want is, disable the close option on a dialog defined by a DialogDescriptor, the user cannot close the dialog unless he press some of the buttons i have defined.



Thanks for any help!





Re: DialogDescriptor close option

by Jesse Glick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

creusar wrote:
> What i realy want is, disable the close option on a dialog defined by a DialogDescriptor, the user cannot close the dialog unless he press some of the buttons i have
> defined.

You will need to pass in a custom button, I think.

http://hg.netbeans.org/main-silver/raw-file/default/hudson/src/org/netbeans/modules/hudson/ui/actions/CreateJob.java


DialogDescriptor close option

by creusar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the answer Jesse!



Do you mean the method DialogDescriptor.setOptions()? I'm already using it, i think i didn't make my self clear... by disable the closing option i mean the close button X on the upper right corner of the dialog. Passing custom buttons/options and setting the closing options (via DialogDescriptor.setClosingOptions()) still let the user close the dialog on the X button.



There is a way to disable it?





Re: DialogDescriptor close option

by Jesse Glick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

creusar wrote:
> by disable the closing option i mean the close button X on the upper right corner of the dialog. Passing custom buttons/options and setting the closing options (via
> DialogDescriptor.setClosingOptions()) still let the user close the dialog on the X button.
>
> There is a way to disable it?

Not that I know of. The user is always permitted to cancel a dialog completely by closing the dialog window.

You can always bypass DialogDisplayer and create your own JDialog if you need more specialized behavior.


DialogDescriptor close option

by creusar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the answers Jesse!