/** Removes listeners. */ @Override public void removeNotify() { super.removeNotify(); listenerActive = false; list.getSelectionModel().removeListSelectionListener(managerListener); // bugfix #23509, remove useless listeners if (manager != null) { manager.removeVetoableChangeListener(wlvc); manager.removePropertyChangeListener(wlpc); } model.removeListDataListener(managerListener); list.removeMouseListener(popupSupport); // #112536: [dafe] I wasn't able to find out real reason for #112536 // Following delaying works, but is hacky a bit and we have to check // if ListView is reused - addNotify called again, which we check through isDisplayable SwingUtilities.invokeLater(new Runnable () { public void run() { if (!isDisplayable()) { // #109123: clear the model, as it may become invalid, because we stopped // tracking ExplorerManager changes through listeners model.setNode(Node.EMPTY); } } }); }
/** Removes listeners. */ public void removeNotify () { super.removeNotify (); listenerActive = false; list.getSelectionModel ().removeListSelectionListener (managerListener); // bugfix #23509, remove useless listeners if (manager != null) { manager.removeVetoableChangeListener (wlvc); manager.removePropertyChangeListener (wlpc); } model.removeListDataListener (managerListener); list.removeFocusListener (popupSupport); list.removeMouseListener (popupSupport); }
/** Removes listeners. */ public void removeNotify () { super.removeNotify (); listenerActive = false; list.getSelectionModel ().removeListSelectionListener (managerListener); // bugfix #23509, remove useless listeners if (manager != null) { manager.removeVetoableChangeListener (wlvc); manager.removePropertyChangeListener (wlpc); } model.removeListDataListener (managerListener); list.removeFocusListener (popupSupport); list.removeMouseListener (popupSupport); }