Changeset 5151 in josm for trunk/src/org
- Timestamp:
- 2012-04-01T18:56:23+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r5079 r5151 17 17 import java.awt.event.ActionListener; 18 18 import java.awt.event.InputEvent; 19 import java.beans.PropertyChangeEvent; 20 import java.beans.PropertyChangeListener; 19 21 import java.io.IOException; 20 22 import java.util.ArrayList; … … 945 947 control.addSeparator(); 946 948 } else { 947 JButton b = control.add(action.getParametrizedAction());949 final JButton b = control.add(action.getParametrizedAction()); 948 950 String tt = action.getDisplayTooltip(); 949 951 if (tt != null && !tt.isEmpty()) 950 952 b.setToolTipText(tt); 951 953 Icon i = action.getDisplayIcon(); 952 if (i != null) 954 if (i != null) { 953 955 b.setIcon(i); 956 } else { 957 // hide action text if an icon is set later (necessary for delayed/background image loading) 958 action.getParametrizedAction().addPropertyChangeListener(new PropertyChangeListener() { 959 960 @Override 961 public void propertyChange(PropertyChangeEvent evt) { 962 if (Action.SMALL_ICON.equals(evt.getPropertyName())) { 963 b.setHideActionText(evt.getNewValue() != null); 964 } 965 } 966 }); 967 } 954 968 b.addMouseListener(new PopupMenuLauncher( new ToolbarPopupMenu(action))); 955 969 }
Note:
See TracChangeset
for help on using the changeset viewer.