Class AbstractVetoableValue<T>

    • Constructor Detail

      • AbstractVetoableValue

        public AbstractVetoableValue()
        Creates a new vetoable value.
      • AbstractVetoableValue

        public AbstractVetoableValue​(Realm realm)
        Parameters:
        realm - the realm
    • Method Detail

      • doSetApprovedValue

        protected abstract void doSetApprovedValue​(T value)
        Sets the value. Invoked after performing veto checks. Should not fire change events.
        Parameters:
        value - the approved value to set
      • fireValueChanging

        protected boolean fireValueChanging​(ValueDiff<T> diff)
        Notifies listeners about a pending change, and returns true if no listener vetoed the change.
        Parameters:
        diff - the pending change
        Returns:
        false if the change was vetoed, true otherwise
      • addListener

        protected void addListener​(Object listenerType,
                                   IObservablesListener listener)
        Parameters:
        listenerType - arbitrary object to identify a type of the listener
        listener - the listener to add; not null
      • removeListener

        protected void removeListener​(Object listenerType,
                                      IObservablesListener listener)
        Parameters:
        listenerType - arbitrary object to identify a type of the listener
        listener - the listener to remove; not null
      • hasListeners

        protected boolean hasListeners()
      • firstListenerAdded

        protected void firstListenerAdded()
      • lastListenerRemoved

        protected void lastListenerRemoved()
      • getRealm

        public Realm getRealm()
        Returns:
        Returns the realm.