Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter. @param path the TreePath indicating the node that was expanded @see EventListenerList
(TreePath path)
| 2851 | * @see EventListenerList |
| 2852 | */ |
| 2853 | public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException { |
| 2854 | // Guaranteed to return a non-null array |
| 2855 | Object[] listeners = listenerList.getListenerList(); |
| 2856 | TreeExpansionEvent e = null; |
| 2857 | // Process the listeners last to first, notifying |
| 2858 | // those that are interested in this event |
| 2859 | for (int i = listeners.length-2; i>=0; i-=2) { |
| 2860 | if (listeners[i]==TreeWillExpandListener.class) { |
| 2861 | // Lazily create the event: |
| 2862 | if (e == null) |
| 2863 | e = new TreeExpansionEvent(this, path); |
| 2864 | ((TreeWillExpandListener)listeners[i+1]). |
| 2865 | treeWillCollapse(e); |
| 2866 | } |
| 2867 | } |
| 2868 | } |
| 2869 | |
| 2870 | /** |
| 2871 | * Adds a listener for <code>TreeSelection</code> events. |
no test coverage detected