Class ChangeForwarder

    • Constructor Detail

      • ChangeForwarder

        public ChangeForwarder​(Object source,
                               ChangeSupport changeSupport)
        Create a new ChangeForwarder for forwarding events.
        Parameters:
        source - the new source Object
        changeSupport - the ChangeSupport managing the listeners
    • Method Detail

      • getSource

        public Object getSource()
        Retrieve the 'source' object for ChangeEvents fired by this forwarder.
        Returns:
        the source Object
      • changeSupport

        public ChangeSupport changeSupport()
        Return the underlying ChangeSupport instance that can be used to fire ChangeEvents and mannage listeners.
        Returns:
        the ChangeSupport delegate
      • generateEvent

        protected ChangeEvent generateEvent​(ChangeEvent ce)
                                     throws ChangeVetoException

        Return the new event to represent the originating event ce.

        The returned ChangeEvent is the event that will be fired, and should be built from information in the original event. If it is null, then no event will be fired.

        The default implementation just constructs a ChangeEvent of the same type that chains back to ce.

        Parameters:
        ce - the originating ChangeEvent
        Returns:
        a new ChangeEvent to pass on, or null if no event should be sent
        Throws:
        ChangeVetoException - if for any reason this event can't be handled
      • preChange

        public void preChange​(ChangeEvent ce)
                       throws ChangeVetoException
        Description copied from interface: ChangeListener

        Called before a change takes place.

        This is your chance to stop the change by throwing a ChangeVetoException. This method does not indicate that the change will definitely take place, so it is not recomended that you take any positive action within this handler.

        Specified by:
        preChange in interface ChangeListener
        Parameters:
        ce - An event encapsulating the change which is about to take place.
        Throws:
        ChangeVetoException - Description of Exception
      • postChange

        public void postChange​(ChangeEvent ce)
        Description copied from interface: ChangeListener

        Called when a change has just taken place.

        This method is the place to perform any behavior in response to the change event.

        Specified by:
        postChange in interface ChangeListener
        Parameters:
        ce - An event encapsulating the change which has occured.