Changeset 1820 in josm for trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
- Timestamp:
- 2009-07-21T19:52:53+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r1814 r1820 23 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 24 import org.openstreetmap.josm.gui.ExtendedDialog; 25 import org.openstreetmap.josm.gui.layer.Layer;26 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;27 25 import org.openstreetmap.josm.tools.GBC; 28 26 import org.openstreetmap.josm.tools.Shortcut; 29 27 30 public class SearchAction extends JosmAction implements LayerChangeListener{28 public class SearchAction extends JosmAction{ 31 29 32 30 public static final int SEARCH_HISTORY_SIZE = 10; … … 43 41 super(tr("Search..."), "dialogs/search", tr("Search for objects."), 44 42 Shortcut.registerShortcut("system:find", tr("Search..."), KeyEvent.VK_F, Shortcut.GROUP_HOTKEY), true); 45 Layer.listeners.add(this);46 refreshEnabled();47 43 } 48 44 … … 240 236 * 241 237 */ 242 protected void refreshEnabled() { 238 @Override 239 protected void updateEnabledState() { 243 240 setEnabled(getEditLayer() != null); 244 241 } 245 246 /* ---------------------------------------------------------------------------------- */247 /* Interface LayerChangeListener */248 /* ---------------------------------------------------------------------------------- */249 public void activeLayerChange(Layer oldLayer, Layer newLayer) {250 refreshEnabled();251 }252 253 public void layerAdded(Layer newLayer) {254 refreshEnabled();255 }256 257 public void layerRemoved(Layer oldLayer) {258 refreshEnabled();259 }260 242 }
Note:
See TracChangeset
for help on using the changeset viewer.