Changeset 3092 in josm for trunk/src/org/openstreetmap/josm/actions/UpdateModifiedAction.java
- Timestamp:
- 2010-03-07T14:34:27+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UpdateModifiedAction.java
r3083 r3092 32 32 } 33 33 34 // FIXME: overrides the behaviour of UpdateSelectionAction. Doesn't update 35 // the enabled state based on the current selection because 36 // it doesn't depend on it. 37 // The action should be enabled/disabled based on whether there is a least 38 // one modified object in the current dataset. Unfortunately, there is no 39 // efficient way to find out here. getDataSet().allModifiedPrimitives() is 40 // too heavy weight because it loops over the whole dataset. 41 // Perhaps this action should be a DataSetListener? Or it could listen to the 42 // REQUIRES_SAVE_TO_DISK_PROP and REQUIRES_UPLOAD_TO_SERVER_PROP properties 43 // in the OsmLayer? 44 // 34 45 @Override 35 protected void updateEnabledState( Collection<? extends OsmPrimitive> selection) {36 s uper.updateEnabledState(getData());46 protected void updateEnabledState() { 47 setEnabled(getCurrentDataSet() != null); 37 48 } 38 49 39 50 @Override 40 protected Collection<OsmPrimitive> getData() { 41 return getCurrentDataSet().allModifiedPrimitives(); 51 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 42 52 } 43 53 }
Note:
See TracChangeset
for help on using the changeset viewer.