Interface IObservable

    • Method Detail

      • getRealm

        Realm getRealm()
        Returns the realm for this observable. Unless otherwise specified, getters and setters must be accessed from within this realm. Listeners will be within this realm when they receive events from this observable.

        Because observables can only be accessed from within one realm, and they always fire events on that realm, their state can be observed in an incremental way. It is always safe to call getters of an observable from within a change listener attached to that observable.

        Returns:
        the realm
      • addChangeListener

        void addChangeListener​(IChangeListener listener)
        Adds the given change listener to the list of change listeners. Change listeners are notified about changes of the state of this observable in a generic way, without specifying the change that happened. To get the changed state, a change listener needs to query for the current state of this observable.
        Parameters:
        listener -
      • removeChangeListener

        void removeChangeListener​(IChangeListener listener)
        Removes the given change listener from the list of change listeners. Has no effect if the given listener is not registered as a change listener.
        Parameters:
        listener -
      • addStaleListener

        void addStaleListener​(IStaleListener listener)
        Adds the given stale listener to the list of stale listeners. Stale listeners are notified when an observable object becomes stale, not when is becomes non-stale.
        Parameters:
        listener -
        See Also:
        isStale()
      • removeStaleListener

        void removeStaleListener​(IStaleListener listener)
        Removes the given stale listener from the list of stale listeners. Has no effect if the given listener is not registered as a stale listener.
        Parameters:
        listener -
      • isStale

        boolean isStale()
        Returns whether the state of this observable is stale and is expected to change soon. A non-stale observable that becomes stale will notify its stale listeners. A stale object that becomes non-stale does so by changing its state and notifying its change listeners, it does not notify its stale listeners about becoming non-stale. Clients that do not expect asynchronous changes may ignore staleness of observable objects.
        Returns:
        true if this observable's state is stale and will change soon.
        "TrackedGetter"
        - implementers must call ObservableTracker.getterCalled(IObservable).
      • addDisposeListener

        void addDisposeListener​(IDisposeListener listener)
        Adds the given dispose listener to the list of dispose listeners. Dispose listeners are notified when an observable has been disposed.
        Parameters:
        listener - the listener to add
        Since:
        1.2
      • removeDisposeListener

        void removeDisposeListener​(IDisposeListener listener)
        Removes the given dispose listener from the list of dispose listeners. Has no effect if the given listener is not registered as a dispose listener.
        Parameters:
        listener - the listener to remove
        Since:
        1.2
      • isDisposed

        boolean isDisposed()
        Returns whether the observable has been disposed
        Returns:
        whether the observable has been disposed
        Since:
        1.2
      • dispose

        void dispose()
        Disposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.