code: private Integer getButtonPriority(Integer button){
          switch (button){
              case Dialog.BUTTON_POSITIVE:
                  return 1;
              case Dialog.BUTTON_NEUTRAL:
                  return 2;
              case Dialog.BUTTON_NEGATIVE:
                  return 3;
              default:
                  return 0;
          }
      }
docs: Get the proper button sorting priority
  
  @param button        the button constant
  @return              the sorting order