Exemplo n.º 1
0
 protected String searchToXML(String searchQuery) {
   String xml = "<search>\r\n";
   if (common.isChecked()) xml += "<commonName>" + searchQuery + "</commonName>\r\n";
   if (sciName.isChecked()) xml += "<sciName>" + searchQuery + "</sciName>\r\n";
   if (countryOfOcc.isChecked())
     xml += "<country>" + countryOfOccText.getText() + "</country>\r\n";
   if (assessor.isChecked()) xml += "<assessor>" + assessorText.getText() + "</assessor>\r\n";
   xml += "</search>";
   return xml;
 }
Exemplo n.º 2
0
  public void updateStateFromView() {
    savedSqlCondition = customSqlBox.getText().trim();
    savedShowInvalid = showInvalid.isChecked();

    savedFilters.clear();
    for (TestFilterWidget filter : filterList.getWidgets()) {
      savedFilters.add(filter.getFilterData());
    }
  }
 public List<DayOfWeek> getCheckedDays() {
   ArrayList<DayOfWeek> checkedDays = new ArrayList<DayOfWeek>();
   for (DayOfWeek d : EnumSet.range(DayOfWeek.SUN, DayOfWeek.SAT)) {
     CheckBox cb = dayToCheckBox.get(d);
     if (cb.isChecked()) {
       checkedDays.add(d);
     }
   }
   return checkedDays;
 }
Exemplo n.º 4
0
 protected void onElementClick() {
   if (fondsCheck.isChecked()
       && subfondsCheck.isChecked()
       && classCheck.isChecked()
       && subclassCheck.isChecked()
       && seriesCheck.isChecked()
       && subseriesCheck.isChecked()
       && fileCheck.isChecked()
       && itemCheck.isChecked()) {
     allLevelsOption.setChecked(true);
   } else {
     chooseLevelsOption.setChecked(true);
   }
 }
Exemplo n.º 5
0
  /**
   * Get search parameters
   *
   * @return an array with the search parameters
   */
  public SearchParameter[] getSearchParameters() {
    SearchParameter[] parameters;

    if (allLevelsOption.isChecked()) {
      parameters = new SearchParameter[] {};
    } else {
      String keyword = "";
      if (fondsCheck.isChecked()) {
        keyword += DescriptionLevel.FONDS + " ";
      }
      if (subfondsCheck.isChecked()) {
        keyword += DescriptionLevel.SUBFONDS + " ";
      }
      if (classCheck.isChecked()) {
        keyword += DescriptionLevel.CLASS + " ";
      }
      if (subclassCheck.isChecked()) {
        keyword += DescriptionLevel.SUBCLASS + " ";
      }
      if (seriesCheck.isChecked()) {
        keyword += DescriptionLevel.SERIES + " ";
      }
      if (subseriesCheck.isChecked()) {
        keyword += DescriptionLevel.SUBSERIES + " ";
      }
      if (fileCheck.isChecked()) {
        keyword += DescriptionLevel.FILE + " ";
      }
      if (itemCheck.isChecked()) {
        keyword += DescriptionLevel.ITEM + " ";
      }

      SearchParameter parameter =
          new DefaultSearchParameter(
              new String[] {EadcSearchFields.LEVEL},
              keyword,
              DefaultSearchParameter.MATCH_AT_LEAST_ONE_WORD);
      parameters = new SearchParameter[] {parameter};
    }
    return parameters;
  }
Exemplo n.º 6
0
  /**
   * Get the list of the selected element levels
   *
   * @return A List of the element levels as defined at SimpleDescriptionObject
   */
  public List<DescriptionLevel> getSelected() {
    List<DescriptionLevel> selected = new ArrayList<DescriptionLevel>();
    if (allLevelsOption.isChecked()) {
      selected.add(DescriptionLevel.FONDS);
      selected.add(DescriptionLevel.SUBFONDS);
      selected.add(DescriptionLevel.CLASS);
      selected.add(DescriptionLevel.SUBCLASS);
      selected.add(DescriptionLevel.SERIES);
      selected.add(DescriptionLevel.SUBSERIES);
      selected.add(DescriptionLevel.FILE);
      selected.add(DescriptionLevel.ITEM);
    } else {
      if (fondsCheck.isChecked()) {
        selected.add(DescriptionLevel.FONDS);
      }
      if (subfondsCheck.isChecked()) {
        selected.add(DescriptionLevel.SUBFONDS);
      }
      if (classCheck.isChecked()) {
        selected.add(DescriptionLevel.CLASS);
      }
      if (subclassCheck.isChecked()) {
        selected.add(DescriptionLevel.SUBCLASS);
      }
      if (seriesCheck.isChecked()) {
        selected.add(DescriptionLevel.SERIES);
      }
      if (subseriesCheck.isChecked()) {
        selected.add(DescriptionLevel.SUBSERIES);
      }
      if (fileCheck.isChecked()) {
        selected.add(DescriptionLevel.FILE);
      }
      if (itemCheck.isChecked()) {
        selected.add(DescriptionLevel.ITEM);
      }
    }

    return selected;
  }
Exemplo n.º 7
0
 public Object getValue() {
   return Boolean.valueOf(widget.isChecked());
 }