Handle the change in a field value. Reset any cached calculated
values affected by this change, pass on the event to any external
listeners.

@param field field changed
@param oldValue old field value
@param newValue new field value
977945
private void fireFieldChangeEvent(TaskField field, Object oldValue, Object newValue)
   {
      //
      // Internal event handling
      //
      switch (field)
      {
         case UNIQUE_ID:
         {
            ProjectFile parent = getParentFile();
            if (oldValue != null)
            {
               parent.getTasks().unmapUniqueID((Integer) oldValue);
            }
            parent.getTasks().mapUniqueID((Integer) newValue, this);
            break;
         }

         case START:
         case BASELINE_START:
         {
            m_array[TaskField.START_VARIANCE.getValue()] = null;
            break;
         }

         case FINISH:
         case BASELINE_FINISH:
         {
            m_array[TaskField.FINISH_VARIANCE.getValue()] = null;
            break;
         }

         case COST:
         case BASELINE_COST:
         {
            m_array[TaskField.COST_VARIANCE.getValue()] = null;
            break;
         }

         case DURATION:
         {
            m_array[TaskField.DURATION_VARIANCE.getValue()] = null;
            m_array[TaskField.COMPLETE_THROUGH.getValue()] = null;
            break;
         }

         case BASELINE_DURATION:
         {
            m_array[TaskField.DURATION_VARIANCE.getValue()] = null;
            break;
         }

         case WORK:
         case BASELINE_WORK:
         {
            m_array[TaskField.WORK_VARIANCE.getValue()] = null;
            break;
         }

         case BCWP:
         case ACWP:
         {
            m_array[TaskField.CV.getValue()] = null;
            m_array[TaskField.SV.getValue()] = null;
            break;
         }

         case BCWS:
         {
            m_array[TaskField.SV.getValue()] = null;
            break;
         }

         case START_SLACK:
         case FINISH_SLACK:
         {
            m_array[TaskField.TOTAL_SLACK.getValue()] = null;
            m_array[TaskField.CRITICAL.getValue()] = null;
            break;
         }

         case EARLY_FINISH:
         case LATE_FINISH:
         {
            m_array[TaskField.FINISH_SLACK.getValue()] = null;
            m_array[TaskField.TOTAL_SLACK.getValue()] = null;
            m_array[TaskField.CRITICAL.getValue()] = null;
            break;
         }

         case EARLY_START:
         case LATE_START:
         {
            m_array[TaskField.START_SLACK.getValue()] = null;
            m_array[TaskField.TOTAL_SLACK.getValue()] = null;
            m_array[TaskField.CRITICAL.getValue()] = null;
            break;
         }

         case ACTUAL_START:
         case PERCENT_COMPLETE:
         {
            m_array[TaskField.COMPLETE_THROUGH.getValue()] = null;
            break;
         }

         default:
         {
            break;
         }
      }

      //
      // External event handling
      //
      if (m_listeners != null)
      {
         for (FieldListener listener : m_listeners)
         {
            listener.fieldChange(this, field, oldValue, newValue);
         }
      }
   }
600094
protected void doNotifyListenersOfChangedValues(Map<K, R> oldValues, Map<K, R> newValues) {
        List<MapValueChangeListener<K, R>> listenersCopy = new ArrayList<MapValueChangeListener<K, R>>(listeners);
        Map<K, R> oldUnmodifiable = Collections.unmodifiableMap(oldValues);
        Map<K, R> newUnmodifiable = Collections.unmodifiableMap(newValues);
        for (MapValueChangeListener<K, R> listener : listenersCopy) {
            listener.valuesChanged(this, oldUnmodifiable, newUnmodifiable);
        }
    }
881301
public void setValue(int newValue) {
		setValue(newValue, true, true);
		spinner.setValue(new Integer(value));
	}
860300
protected void fireValueChange(boolean force) {

        String currentValue = getValue();
        if (force || !currentValue.equals(m_previousValue)) {
            m_previousValue = currentValue;
            ValueChangeEvent.fire(this, currentValue);
        }

    }
1124243
public void setValue(Object newValue) {
        synchronized (lock) {
            // Allow only once.
            if (ready) {
                return;
            }

            result = newValue;
            ready = true;
            if (waiters > 0) {
                lock.notifyAll();
            }
        }

        notifyListeners();
    }
329756
private boolean hasChanged( int[] oldValue, int[] newValue ) {
        if( oldValue.length == newValue.length ) {
            for( int i = 0; i < newValue.length; i++ ) {
                if( oldValue[i] != newValue[i] ) {
                    return true;
                }
            }
            return false;
        }
        return true;
    }
979608
protected void fireChange(Date newValue, boolean isTyping) {

        ValueChangeEvent.<Date> fireIfNotEqual(this, m_oldValue, CalendarUtil.copyDate(newValue));
        CmsDateBoxEvent.fire(this, newValue, isTyping);
        m_oldValue = newValue;
    }
400802
protected void firePropertyChange(String name, Object oldValue, Object newValue) {
        _propertyChangeSupport.firePropertyChange(name, oldValue, newValue);
    }
765794
public void setValue(Object newValue) {
        Object checkedValue = checkValue(newValue);
        setDirty(isDifferent(baseValue, checkedValue));
        if (isDifferent(value, checkedValue)){ // firePropertyChange doesn't do this check sufficiently
            firePropertyChange(VALUE, value, value = checkedValue); // set inline to avoid recursion
        }
    }
383597
protected void valueChanged()
	{
		String newValue = fViewer.getDocument().get();
		if (!newValue.equals(fOldValue))
		{
			fOldValue = newValue;

		}
		refreshValidState();
	}
801822
private void setValue(boolean focused) {
        if (!ValueUtils.areEqual(this.focused, focused)) {
            boolean oldValue = this.focused;
            this.focused = focused;
            maybeNotifyListeners(oldValue, focused);
        }
    }
1148440
function(fields, oldValue) {
            fields = this.__resolveFields(fields);

            var prop, key, i, ii;

            this.__checkEmitEvent(true);

            if (_.isSimpleObject(oldValue)) {
                for (key in oldValue) {
                    this.__emitPropertyRemove(fields.concat(key), oldValue[key]);
                }
            }
            else if (_.isArray(oldValue)) {
                for (i = 0, ii = oldValue.length; i < ii; ++i) {
                    this.__emitPropertyRemove(fields.concat(i), oldValue[i]);
                }
            }

            prop = fields.join('.');

            this.__emitEvent('property.' + prop + '.clear', oldValue);
            this.__emitEvent('property.clear', prop, oldValue);

            return this;
        }
466034
@UiHandler("m_dateModifiedEndDateBox")
    protected void onDateModifiedEndChange(ValueChangeEvent<Date> event) {

        if (event.getValue() != null) {
            m_tabHandler.setDateModifiedEnd(event.getValue().getTime());
        } else {
            // if the field is empty take the max value
            m_tabHandler.setDateModifiedEnd(-1L);
        }
    }
1006780
@Override
    protected void valueModelChanged(Object newValue) {
        if (newValue == null)
            setKeyComponentText(null);
        else
            setKeyComponentText(getObjectLabel(newValue));
        readOnlyChanged();
    }
1274422
public function setNewValue($field, $value)
    {
        $this->assertValidField($field);

        $this->documentChangeSet[$field][1] = $value;
    }
308935
public void onValueChange(ValueChangeEvent<String> event) {

        String message = null;
        boolean enableOk = true;
        if (m_isCreateNew) {
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_fileName.getFormValueAsString())) {
                enableOk = false;
                message = Messages.get().key(Messages.GUI_EDIT_LINK_NO_FILE_NAME_0);
            } else if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_linkContent.getFormValueAsString())) {
                enableOk = false;
                message = Messages.get().key(Messages.GUI_EDIT_LINK_NO_LINK_0);
            }
        } else {
            if ((m_linkContent.getFormValueAsString().equals(m_previousLink)
                && (m_linkTitle.getFormValueAsString().equals(m_previousTitle)))) {
                enableOk = false;
                message = Messages.get().key(Messages.GUI_EDIT_LINK_NO_CHANGES_0);
            } else if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_linkContent.getFormValueAsString())) {
                enableOk = false;
                message = Messages.get().key(Messages.GUI_EDIT_LINK_NO_LINK_0);
            }
        }
        setOkEnabled(enableOk, message);
    }
388928
protected Object handleColumnValue(final Object oldValue, final Database database) {
      final Object newValue = WktConversionUtils.handleColumnValue(oldValue, database, this);
      return newValue;
   }