Interface Changeable

    • Method Detail

      • addChangeListener

        void addChangeListener​(ChangeListener listener)
        Add a change listener. Each listener will be notified of the execution (or failure) of each change request that is executed via the requestChange() method. Implementors are free to delegate both the request and the listener to other objects (e.g. the container), so the listener may be notified of more changes than those requested through the requestChange() method of this object. Implementors are required to not add a listener that is already on the list of listeners (i.e., objects should not appear more than once on the list).
        Parameters:
        listener - The listener to add.
        See Also:
        removeChangeListener(ChangeListener), requestChange(ChangeRequest)
      • isDeferringChangeRequests

        boolean isDeferringChangeRequests()
        Return true if setDeferringChangeRequests(true) has been called to specify that change requests should be deferred.
        Returns:
        True if change requests are being deferred.
        See Also:
        setDeferringChangeRequests(boolean)
      • removeChangeListener

        void removeChangeListener​(ChangeListener listener)
        Remove a change listener, if it is present, and otherwise do nothing.
        Parameters:
        listener - The listener to remove.
        See Also:
        addChangeListener(ChangeListener)
      • requestChange

        void requestChange​(ChangeRequest change)
        Request that the given change be executed. An implementor is free to delegate this request to another object (e.g. the container). It may also execute the request immediately, unless this object is deferring change requests. If setDeferChangeRequests() has been called with a true argument, then an implementor is expected to queue the request until either setDeferChangeRequests() is called with a false argument or executeChangeRequests() is called. If an implementor is already in the middle of executing a change request, then the implementor is expected to finish that execution before executing this one. Change listeners will be notified of success (or failure) of the request when it is executed.
        Parameters:
        change - The requested change.
        See Also:
        executeChangeRequests(), setDeferringChangeRequests(boolean)
      • setDeferringChangeRequests

        void setDeferringChangeRequests​(boolean isDeferring)
        Specify whether change requests made by calls to requestChange() should be executed immediately. An implementor is free to delegate this to another object implementing Changeable (e.g. the container). If the argument is true, then an implementor is expected to queue requests until either this method is called again with argument false, or until executeChangeRequests() is called. If the argument is false, then execute any pending change requests and set a flag requesting that future requests be executed immediately.
        Parameters:
        isDeferring - If true, defer change requests.
        See Also:
        addChangeListener(ChangeListener), executeChangeRequests(), isDeferringChangeRequests(), requestChange(ChangeRequest)