- Timestamp:
- 2018-12-22T19:42:50+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r14470 r14589 470 470 Config.getPref().removePreferenceChangeListener(this); 471 471 GuiHelper.destroyComponents(this, false); 472 titleBar.destroy(); 473 titleBar = null; 474 this.buttonActions.clear(); 472 475 } 473 476 … … 501 504 * The title bar displayed in docked mode 502 505 */ 503 protected class TitleBar extends JPanel {506 protected class TitleBar extends JPanel implements Destroyable { 504 507 /** the label which shows whether the toggle dialog is expanded or collapsed */ 505 508 private final JLabel lblMinimized; … … 511 514 /** the contextual menu **/ 512 515 private DialogPopupMenu popupMenu; 516 517 private MouseEventHandler mouseEventHandler; 513 518 514 519 @SuppressWarnings("unchecked") … … 633 638 public final void registerMouseListener() { 634 639 popupMenu = new DialogPopupMenu(); 635 addMouseListener(new MouseEventHandler()); 640 mouseEventHandler = new MouseEventHandler(); 641 addMouseListener(mouseEventHandler); 636 642 } 637 643 … … 656 662 } 657 663 } 664 } 665 666 @Override 667 public void destroy() { 668 removeMouseListener(mouseEventHandler); 669 this.mouseEventHandler = null; 670 this.popupMenu = null; 658 671 } 659 672 } … … 754 767 */ 755 768 public void setTitle(String title) { 756 titleBar.setTitle(title); 769 if (titleBar != null) { 770 titleBar.setTitle(title); 771 } 757 772 if (detachedDialog != null) { 758 773 detachedDialog.setTitle(title);
Note:
See TracChangeset
for help on using the changeset viewer.