Changeset 15633 in josm for trunk/src/org/openstreetmap/josm/gui/MapFrame.java
- Timestamp:
- 2020-01-05T16:36:31+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r15445 r15633 44 44 import javax.swing.plaf.basic.BasicSplitPaneUI; 45 45 46 import org.openstreetmap.josm.actions.ExpertToggleAction; 46 47 import org.openstreetmap.josm.actions.mapmode.DeleteAction; 47 48 import org.openstreetmap.josm.actions.mapmode.DrawAction; … … 671 672 JPopupMenu menu = new JPopupMenu(); 672 673 for (HideableButton b : buttons) { 673 final HideableButton t = b; 674 menu.add(new JCheckBoxMenuItem(new AbstractAction() { 675 { 676 putValue(NAME, t.getActionName()); 677 putValue(SMALL_ICON, t.getIcon()); 678 putValue(SELECTED_KEY, t.isButtonVisible()); 679 putValue(SHORT_DESCRIPTION, tr("Hide or show this toggle button")); 680 } 681 682 @Override 683 public void actionPerformed(ActionEvent e) { 684 if ((Boolean) getValue(SELECTED_KEY)) { 685 t.showButton(); 686 } else { 687 t.hideButton(); 674 if (!b.isExpert() || ExpertToggleAction.isExpert()) { 675 final HideableButton t = b; 676 menu.add(new JCheckBoxMenuItem(new AbstractAction() { 677 { 678 putValue(NAME, t.getActionName()); 679 putValue(SMALL_ICON, t.getIcon()); 680 putValue(SELECTED_KEY, t.isButtonVisible()); 681 putValue(SHORT_DESCRIPTION, tr("Hide or show this toggle button")); 688 682 } 689 validateToolBarsVisibility(); 690 } 691 })); 683 684 @Override 685 public void actionPerformed(ActionEvent e) { 686 if ((Boolean) getValue(SELECTED_KEY)) { 687 t.showButton(); 688 } else { 689 t.hideButton(); 690 } 691 validateToolBarsVisibility(); 692 } 693 })); 694 } 692 695 } 693 696 if (button != null && button.isShowing()) {
Note:
See TracChangeset
for help on using the changeset viewer.