Esempio n. 1
0
  @Override
  public void saveValueToXML(Element xmlElement) {
    if (value == null) return;
    Document parentDocument = xmlElement.getOwnerDocument();
    xmlElement.setAttribute("type", value.getSelectionType().name());

    if (value.getSpecificPeakLists() != null) {
      for (PeakList item : value.getSpecificPeakLists()) {
        Element newElement = parentDocument.createElement("specific_peak_list");
        newElement.setTextContent(item.getName());
        xmlElement.appendChild(newElement);
      }
    }

    if (value.getNamePattern() != null) {
      Element newElement = parentDocument.createElement("name_pattern");
      newElement.setTextContent(value.getNamePattern());
      xmlElement.appendChild(newElement);
    }
  }
Esempio n. 2
0
  @Override
  public boolean checkValue(Collection<String> errorMessages) {
    PeakList matchingPeakLists[];
    if (value == null) matchingPeakLists = new PeakList[0];
    else matchingPeakLists = value.getMatchingPeakLists();

    if (matchingPeakLists.length < minCount) {
      errorMessages.add("At least " + minCount + " peak lists  must be selected");
      return false;
    }
    if (matchingPeakLists.length > maxCount) {
      errorMessages.add("Maximum " + maxCount + " peak lists may be selected");
      return false;
    }
    return true;
  }
Esempio n. 3
0
 @Override
 public PeakListsParameter cloneParameter() {
   PeakListsParameter copy = new PeakListsParameter(minCount, maxCount);
   if (value != null) copy.value = value.clone();
   return copy;
 }
Esempio n. 4
0
 public void setValue(PeakListsSelectionType selectionType) {
   if (value == null) value = new PeakListsSelection();
   value.setSelectionType(selectionType);
 }
Esempio n. 5
0
 public void setValue(PeakListsSelectionType selectionType, PeakList peakLists[]) {
   if (value == null) value = new PeakListsSelection();
   value.setSelectionType(selectionType);
   value.setSpecificPeakLists(peakLists);
 }