Beispiel #1
0
  /** Called whenever any filter value changes. */
  protected void onFilterValueChange() {
    TaskInboxFilterBean newState = new TaskInboxFilterBean();
    int priorityVal = -1;
    if (priority.getValue().trim().length() > 0) {
      try {
        priorityVal = Integer.parseInt(priority.getValue());
      } catch (NumberFormatException nfe) {
      }
    }
    newState
        .setOwner(
            TaskOwnerEnum.valueOf(
                ownerAny.getValue(),
                ownerMine.getValue(),
                ownerActive.getValue(),
                ownerGroup.getValue()))
        .setPriority(priorityVal)
        .setDateDueFrom(dateDueFrom.getDateValue())
        .setDateDueTo(dateDueTo.getDateValue());

    TaskInboxFilterBean oldState = this.currentState;
    this.currentState = newState;
    // Only fire a change event if something actually changed.
    ValueChangeEvent.fireIfNotEqual(this, oldState, currentState);
  }
Beispiel #2
0
 @Override
 public void setValue(List<M> value, boolean fireEvents) {
   List<M> oldValue = getValue();
   setItems(value);
   if (fireEvents) {
     ValueChangeEvent.fireIfNotEqual(this, oldValue, value);
   }
 }
Beispiel #3
0
  public void setValue(Integer value, boolean fireEvents) {

    if (this.value.compareTo(value) != 0) {
      final Integer oldValue = this.value;
      this.value = value;
      render();
      ValueChangeEvent.<Integer>fireIfNotEqual(this, oldValue, value);
    }
  }
  public void setValue(T value, boolean fireEvents) {
    final T oldValue = getValue();

    this.currentValue = value;
    for (Entry<T, RadioButton> entry : radios.entrySet()) {
      entry.getValue().setValue(entry.getKey().equals(this.currentValue));
    }

    if (fireEvents) {
      ValueChangeEvent.fireIfNotEqual(this, oldValue, this.currentValue);
    }
  }
  @Override
  public void setValue(List<Group> groups, boolean fireEvents) {
    List<Group> before = this.selectedValues;
    super.setValue(groups, false);

    if (groups != null) {
      for (Group g : groups) {
        GroupPanel panel = panels.get(g.getId());
        if (panel != null) {
          panel.setGroup(g);
        }
      }
    }
    if (fireEvents) {
      ValueChangeEvent.fireIfNotEqual(this, before, groups);
    }
  }
Beispiel #6
0
 @Override
 public void setValue(String value, boolean fireEvents) {
   try {
     Number newValue = numberType.parseValue(value);
     if (newValue == null
         || maxConstrained && newValue.intValue() > max
         || minConstrained && newValue.intValue() < min) {
       return;
     }
     String prevText = getValue();
     setText(numberType.formatValue(newValue));
     if (fireEvents) {
       ValueChangeEvent.fireIfNotEqual(this, getValue(), prevText);
     }
   } catch (Exception ex) {
     // Do Nothing
   }
 }
Beispiel #7
0
 /** @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean) */
 @Override
 public void setValue(TaskInboxFilterBean value, boolean fireEvents) {
   if (value.getOwner() == TaskOwnerEnum.any) {
     ownerAny.setValue(true);
   } else if (value.getOwner() == TaskOwnerEnum.mine) {
     ownerMine.setValue(true);
   } else if (value.getOwner() == TaskOwnerEnum.active) {
     ownerActive.setValue(true);
   } else if (value.getOwner() == TaskOwnerEnum.group) {
     ownerGroup.setValue(true);
   }
   priority.setValue(
       value.getPriority() == -1 ? "" : String.valueOf(value.getPriority())); // $NON-NLS-1$
   dateDueFrom.setDateValue(value.getDateDueFrom() == null ? null : value.getDateDueFrom());
   dateDueTo.setDateValue(value.getDateDueTo() == null ? null : value.getDateDueTo());
   TaskInboxFilterBean oldState = this.currentState;
   currentState = value;
   if (fireEvents) {
     ValueChangeEvent.fireIfNotEqual(this, oldState, currentState);
   }
 }
Beispiel #8
0
  /**
   * Fires the value change event if needed.
   *
   * <p>
   *
   * @param oldValue the old value
   * @param newValue the new value
   */
  protected void fireChange(Date oldValue, Date newValue) {

    ValueChangeEvent.<Date>fireIfNotEqual(this, oldValue, CalendarUtil.copyDate(newValue));
  }
 private void fireValueChangeHandler(String value) {
   ValueChangeEvent.fireIfNotEqual(this, lastValue, value);
   lastValue = value;
 }