Esempio n. 1
0
 private void replaceWith(CourseSelectionBox other) {
   hideSuggestionList();
   if (other != null) other.hideSuggestionList();
   setError(other == null ? null : other.getError());
   setEnabled(
       other == null ? iPrimary == null || !iPrimary.getValue().isEmpty() : other.isEnabled());
   if (iPrimary != null) setHint(other == null ? "" : other.getHint());
   setValue(other == null ? null : other.getValue(), false);
   if (iAlternative != null) iAlternative.replaceWith(other == null ? null : other.iAlternative);
   if (iWaitList != null) {
     iWaitList.setValue(
         other == null || other.iWaitList == null ? false : other.iWaitList.getValue());
   }
 }
Esempio n. 2
0
 private void swapWith(CourseSelectionBox other) {
   hideSuggestionList();
   other.hideSuggestionList();
   String x = getError();
   setError(other.getError());
   other.setError(x);
   boolean b = isEnabled();
   setEnabled(other.isEnabled());
   other.setEnabled(b);
   if (iPrimary != null) {
     x = getHint();
     setHint(other.getHint());
     other.setHint(x);
   }
   x = getValue();
   setValue(other.getValue(), false);
   other.setValue(x, false);
   if (iAlternative != null) iAlternative.swapWith(other.iAlternative);
   if (iWaitList != null && other.iWaitList != null) {
     Boolean ch = iWaitList.getValue();
     iWaitList.setValue(other.iWaitList.getValue());
     other.iWaitList.setValue(ch);
   }
 }