/** * Removes any listeners this {@link FocusTracker} added anywhere allowing this {@link FocusTracker} * to be collected by the garbage collector. */ public void destroy(){ remove( root ); }
/** * Removes any listeners this {@link FocusTracker} added anywhere allowing this {@link FocusTracker} * to be collected by the garbage collector. */ public void destroy(){ remove( root ); }
public void componentRemoved( ContainerEvent e ){ remove( e.getChild() ); }
public void componentRemoved( ContainerEvent e ){ remove( e.getChild() ); }
/** * Removes listeners from <code>component</code> and its children. * @param component the component to remove */ protected void remove( Component component ){ if( lastFocused == component ){ lastFocused = null; } component.removeFocusListener( focusListener ); if( component instanceof Container ){ Container container = (Container)component; container.removeContainerListener( containerListener ); for( int i = 0, n = container.getComponentCount(); i<n; i++ ){ remove( container.getComponent( i )); } } } }
/** * Removes listeners from <code>component</code> and its children. * @param component the component to remove */ protected void remove( Component component ){ if( lastFocused == component ){ lastFocused = null; } component.removeFocusListener( focusListener ); if( component instanceof Container ){ Container container = (Container)component; container.removeContainerListener( containerListener ); for( int i = 0, n = container.getComponentCount(); i<n; i++ ){ remove( container.getComponent( i )); } } } }