code: private void adaptPositiveButtonEnableState(final boolean enabled) {
          Button button = getDialog().getButton(DialogInterface.BUTTON_POSITIVE);
  
          if (button != null) {
              button.setEnabled(enabled);
          }
      }
docs: Adapts the enable state of the dialog's positive button.
  
  @param enabled
  True, if the button should be enabled, false otherwise