Esempio n. 1
0
  private void setDefaultText() {

    String dataPlaceHolder = selectElement.getAttribute("data-placeholder");

    if (dataPlaceHolder != null && dataPlaceHolder.length() > 0) {
      defaultText = dataPlaceHolder;
    } else if (isMultiple) {
      if (options.getPlaceholderTextMultiple() != null) {
        defaultText = options.getPlaceholderTextMultiple();
      } else if (options.getPlaceholderText() != null) {
        defaultText = options.getPlaceholderText();
      } else {
        defaultText = "Select Some Options";
      }
    } else {
      if (options.getPlaceholderTextSingle() != null) {
        defaultText = options.getPlaceholderTextSingle();
      } else if (options.getPlaceholderText() != null) {
        defaultText = options.getPlaceholderText();
      } else {
        defaultText = "Select an Option";
      }
    }

    String dataNoResultsText = selectElement.getAttribute("data-no_results_text");
    if (dataNoResultsText != null && dataNoResultsText.length() > 0) {
      resultsNoneFound = dataNoResultsText;
    } else if (options.getNoResultsText() != null) {
      resultsNoneFound = options.getNoResultsText();
    } else {
      resultsNoneFound = "No results match";
    }
  }