@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); } }
@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; }
@Override public PeakListsParameter cloneParameter() { PeakListsParameter copy = new PeakListsParameter(minCount, maxCount); if (value != null) copy.value = value.clone(); return copy; }
public void setValue(PeakListsSelectionType selectionType) { if (value == null) value = new PeakListsSelection(); value.setSelectionType(selectionType); }
public void setValue(PeakListsSelectionType selectionType, PeakList peakLists[]) { if (value == null) value = new PeakListsSelection(); value.setSelectionType(selectionType); value.setSpecificPeakLists(peakLists); }