Changeset 6170 in josm
- Timestamp:
- 2013-08-21T12:56:46+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r6104 r6170 73 73 * 74 74 */ 75 public class ToggleDialog extends JPanel implements ShowHideButtonListener, Helpful, AWTEventListener {75 public class ToggleDialog extends JPanel implements ShowHideButtonListener, Helpful, AWTEventListener, Destroyable { 76 76 77 77 public enum ButtonHiddingType { … … 398 398 } 399 399 400 @Override 400 401 public void destroy() { 401 402 closeDetachedDialog(); … … 403 404 Main.main.menu.windowMenu.remove(windowMenuItem); 404 405 Toolkit.getDefaultToolkit().removeAWTEventListener(this); 405 destroyComponents(this );406 } 407 408 private void destroyComponents(Component component ) {406 destroyComponents(this, false); 407 } 408 409 private void destroyComponents(Component component, boolean destroyItself) { 409 410 if (component instanceof Container) { 410 411 for (Component c: ((Container)component).getComponents()) { 411 destroyComponents(c );412 } 413 } 414 if ( component instanceof Destroyable) {412 destroyComponents(c, true); 413 } 414 } 415 if (destroyItself && component instanceof Destroyable) { 415 416 ((Destroyable) component).destroy(); 416 417 }
Note:
See TracChangeset
for help on using the changeset viewer.