Changeset 13647 in josm for trunk/src/org/openstreetmap/josm/actions/JosmAction.java
- Timestamp:
- 2018-04-19T20:37:16+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r13611 r13647 36 36 import org.openstreetmap.josm.tools.Destroyable; 37 37 import org.openstreetmap.josm.tools.ImageProvider; 38 import org.openstreetmap.josm.tools.ImageResource; 38 39 import org.openstreetmap.josm.tools.Logging; 39 40 import org.openstreetmap.josm.tools.Shortcut; … … 81 82 String toolbarId, boolean installAdapters) { 82 83 super(name); 83 if (icon != null) 84 icon.getResource().attachImageIcon(this, true); 84 if (icon != null) { 85 ImageResource resource = icon.getResource(); 86 if (resource != null) { 87 resource.attachImageIcon(this, true); 88 } 89 } 85 90 setHelpId(); 86 91 sc = shortcut; … … 119 124 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar, 120 125 String toolbarId, boolean installAdapters) { 121 this(name, iconName == null ? null : new ImageProvider(iconName) , tooltip, shortcut, registerInToolbar,126 this(name, iconName == null ? null : new ImageProvider(iconName).setOptional(true), tooltip, shortcut, registerInToolbar, 122 127 toolbarId == null ? iconName : toolbarId, installAdapters); 123 128 }
Note:
See TracChangeset
for help on using the changeset viewer.