コード例 #1
0
 /**
  * Sets an activity indicator on this Alert.
  *
  * @param newIndicator the activity indicator for this Alert, or null if there is none
  * @throws IllegalArgumentException if indicator does not meet the restrictions for its use in an
  *     Alert
  */
 public void setIndicator(Gauge newIndicator) {
   if (newIndicator != null && !newIndicator.isSuitableForAlert()) {
     throw new IllegalArgumentException(MsgRepository.ALERT_EXCEPTION_INVALID_INDICATOR);
   }
   // remove old Gauge parent
   if (indicator != null) {
     indicator.setParent(null);
   }
   // store the indicator
   indicator = newIndicator;
   // set new Gauge parent
   if (indicator != null) {
     indicator.setParent(this);
   }
   updateIndicator();
 }