diff --git a/core.windows/apichanges.xml b/core.windows/apichanges.xml --- a/core.windows/apichanges.xml +++ b/core.windows/apichanges.xml @@ -107,7 +107,20 @@ - + + + + Added default closing option to do nothing when no option is passed. + + + + + + When younow pass no clossing options when you setClosingOptions(new Object[]{}); the dialogue will not close via the ESC key. + + + + Actions to load or save state of windowsystem diff --git a/core.windows/manifest.mf b/core.windows/manifest.mf --- a/core.windows/manifest.mf +++ b/core.windows/manifest.mf @@ -6,5 +6,5 @@ OpenIDE-Module-Recommends: org.netbeans.core.windows.nativeaccess.NativeWindowSystem AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 2.27 +OpenIDE-Module-Specification-Version: 2.28 diff --git a/core.windows/src/org/netbeans/core/windows/services/NbPresenter.java b/core.windows/src/org/netbeans/core/windows/services/NbPresenter.java --- a/core.windows/src/org/netbeans/core/windows/services/NbPresenter.java +++ b/core.windows/src/org/netbeans/core/windows/services/NbPresenter.java @@ -581,6 +581,9 @@ Object[] options = getClosingOptions (); if (options == null) return ; + if (options.length == 0) { + setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + } for (int i = 0; i < options.length; i++) { modifyListener (options[i], buttonListener, init); } @@ -1256,7 +1259,12 @@ MenuElement[] selPath = MenuSelectionManager.defaultManager().getSelectedPath(); // part of #130919 fix - handle ESC key well in dialogs with menus if (selPath == null || selPath.length == 0) { - pressedOption = NotifyDescriptor.CLOSED_OPTION; + //check if closingOptions is != null && 0 + if (getClosingOptions() != null && getClosingOptions().length == 0) { + pressedOption = WindowConstants.DO_NOTHING_ON_CLOSE; + } else { + pressedOption = NotifyDescriptor.CLOSED_OPTION; + } } else { MenuSelectionManager.defaultManager().clearSelectedPath(); return ;