Changeset 4127 in josm
- Timestamp:
- 2011-06-07T23:29:54+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r3906 r4127 258 258 public IconToggleButton addToggleDialog(final ToggleDialog dlg) { 259 259 final IconToggleButton button = new IconToggleButton(dlg.getToggleAction()); 260 toolBarToggle.add(button);261 260 button.addMouseListener(new PopupMenuLauncher(new JPopupMenu() { 262 261 { … … 270 269 public void actionPerformed(ActionEvent e) { 271 270 dlg.hideButton(); 271 validateToolBarToggle(); 272 272 } 273 273 }); … … 275 275 })); 276 276 dlg.setButton(button); 277 if (button.isVisible()) { 278 toolBarToggle.add(button); 279 } 277 280 allDialogs.add(dlg); 278 281 if (dialogsPanel.initialized) { … … 280 283 } 281 284 return button; 285 } 286 287 public void validateToolBarToggle() { 288 toolBarToggle.removeAll(); 289 for (ToggleDialog dlg : allDialogs) { 290 if (dlg.getButton().isVisible()) { 291 toolBarToggle.add(dlg.getButton()); 292 } 293 } 282 294 } 283 295 … … 381 393 if ((Boolean) getValue(SELECTED_KEY)) { 382 394 t.showButton(); 395 validateToolBarToggle(); 383 396 } else { 384 397 t.hideButton(); 398 validateToolBarToggle(); 385 399 } 386 400 }
Note:
See TracChangeset
for help on using the changeset viewer.