Interface TreePreExpansionListener

  • All Superinterfaces:
    EventListener, FormEventListener

    public interface TreePreExpansionListener
    extends FormEventListener

    An event listener interface to be implemented by objects that need to be notified before the expansion state of a tree's node changes.

    This interface is very similar in usage and purpose as the TreeExpansionListener interface. There are two main differences:

    • Event listeners are notified before the affected node is actually expanded or collapsed. This makes it possible for instance to implement a dynamic loading mechanism: The first time a node is expanded the listener can check whether further data is available. It can then add the data found to the tree.
    • Event listeners have the opportunity to veto against the expand or collapse operation. This can be done by throwing an exception in the listener method.

    Version:
    $Id: TreePreExpansionListener.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Method Detail

      • beforeExpansionStateChange

        void beforeExpansionStateChange​(TreeExpansionEvent event)
                                 throws TreeExpandVetoException
        A node of a tree is about to change its expansion state. The passed in event contains all information available about the objects involved. The listener can permit this operation or, by throwing an exception, abort it.
        Parameters:
        event - the event
        Throws:
        TreeExpandVetoException - thrown to indicate that this operation should be aborted