Changeset 14835 in josm


Ignore:
Timestamp:
2019-03-05T15:04:58+01:00 (7 weeks ago)
Author:
GerdP
Message:

see #17343: prepare solution

updateEnabledState() should be called in ValidatorDialog

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ValidateAction.java

    r14666 r14835  
    1212import java.util.Optional;
    1313
     14import org.openstreetmap.josm.data.osm.DataSet;
    1415import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1516import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
     
    9596    @Override
    9697    public void updateEnabledState() {
    97         setEnabled(getLayerManager().getActiveDataSet() != null);
     98        DataSet ds = getLayerManager().getActiveDataSet() ;
     99        setEnabled(ds != null && !ds.isEmpty());
    98100    }
    99101
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r14556 r14835  
    12011201        this.remark = remark;
    12021202    }
     1203
     1204    /**
     1205     * @return true if this Dataset contains no primitives
     1206     * @since 14835
     1207     */
     1208    public boolean isEmpty() {
     1209        return allPrimitives.isEmpty();
     1210    }
    12031211}
Note: See TracChangeset for help on using the changeset viewer.