File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
core.windows/src/org/netbeans/core/windows/services
openide.dialogs/src/org/openide Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -661,13 +661,16 @@ protected final void initializeButtons() {
661661 }
662662 currentPrimaryButtons = new Component [primaryOptions .length ];
663663 for (int i = 0 ; i < primaryOptions .length ; i ++) {
664- if (primaryOptions [i ] == NotifyDescriptor .YES_OPTION ) {
665- currentPrimaryButtons [i ] = stdYesButton ;
664+ if (primaryOptions [i ] == NotifyDescriptor .OK_OPTION ||
665+ primaryOptions [i ] == NotifyDescriptor .YES_OPTION ) {
666+ if (Arrays .asList (primaryOptions ).contains (NotifyDescriptor .NO_OPTION )) {
667+ currentPrimaryButtons [i ] = stdYesButton ;
668+ } else {
669+ currentPrimaryButtons [i ] = stdOKButton ;
670+ stdOKButton .setEnabled (descriptor .isValid ());
671+ }
666672 } else if (primaryOptions [i ] == NotifyDescriptor .NO_OPTION ) {
667673 currentPrimaryButtons [i ] = stdNoButton ;
668- } else if (primaryOptions [i ] == NotifyDescriptor .OK_OPTION ) {
669- currentPrimaryButtons [i ] = stdOKButton ;
670- stdOKButton .setEnabled (descriptor .isValid ());
671674 } else if (primaryOptions [i ] == NotifyDescriptor .CANCEL_OPTION ) {
672675 currentPrimaryButtons [i ] = stdCancelButton ;
673676 } else if (primaryOptions [i ] == NotifyDescriptor .CLOSED_OPTION ) {
Original file line number Diff line number Diff line change @@ -134,19 +134,19 @@ public class NotifyDescriptor extends Object {
134134 //
135135
136136 /** Return value if YES is chosen. */
137- public static final Object YES_OPTION = new Integer ( JOptionPane .YES_OPTION ) ;
137+ public static final Object YES_OPTION = JOptionPane .YES_OPTION ;
138138
139139 /** Return value if NO is chosen. */
140- public static final Object NO_OPTION = new Integer ( JOptionPane .NO_OPTION ) ;
140+ public static final Object NO_OPTION = JOptionPane .NO_OPTION ;
141141
142142 /** Return value if CANCEL is chosen. */
143- public static final Object CANCEL_OPTION = new Integer ( JOptionPane .CANCEL_OPTION ) ;
143+ public static final Object CANCEL_OPTION = JOptionPane .CANCEL_OPTION ;
144144
145145 /** Return value if OK is chosen. */
146- public static final Object OK_OPTION = new Integer ( JOptionPane .OK_OPTION ) ;
146+ public static final Object OK_OPTION = JOptionPane .OK_OPTION ;
147147
148148 /** Return value if user closes the window without pressing any button. */
149- public static final Object CLOSED_OPTION = new Integer ( JOptionPane .CLOSED_OPTION ) ;
149+ public static final Object CLOSED_OPTION = JOptionPane .CLOSED_OPTION ;
150150
151151 //
152152 // Option types
You can’t perform that action at this time.
0 commit comments