Exemplo n.º 1
0
 public void moveUp() {
   if (iPrimary != null) {
     iPrimary.moveUp();
   } else {
     if (iPrev == null) {
       clearAll();
     } else {
       iPrev.moveUp();
       swapWith(iPrev);
     }
   }
 }
Exemplo n.º 2
0
 public void remove() {
   if (iPrimary != null) {
     iPrimary.remove();
   } else {
     if (iNext != null && isAllowFreeTime() == iNext.isAllowFreeTime()) {
       replaceWith(iNext);
       iNext.remove();
     } else {
       replaceWith(null);
     }
   }
 }
Exemplo n.º 3
0
 public void moveDown() {
   if (iPrimary != null) {
     iPrimary.moveDown();
   } else {
     if (iNext == null) {
       clearAll();
     } else {
       iNext.moveDown();
       swapWith(iNext);
     }
   }
 }
Exemplo n.º 4
0
 public void swapUp() {
   if (iPrimary != null) {
     iPrimary.swapUp();
   } else {
     swapWith(iPrev);
   }
 }
Exemplo n.º 5
0
 public void swapDown() {
   if (iPrimary != null) {
     iPrimary.swapDown();
   } else {
     swapWith(iNext);
   }
 }
Exemplo n.º 6
0
 private void clearAllAlternatives() {
   if (iPrimary != null) {
     setHint("");
   }
   setValue(null);
   if (iAlternative != null) iAlternative.clearAllAlternatives();
 }
Exemplo n.º 7
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);
   }
 }
Exemplo n.º 8
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());
   }
 }
Exemplo n.º 9
0
 private void clearAll() {
   if (iPrimary != null) iPrimary.clearAll();
   else clearAllAlternatives();
 }