Changeset 13956 in josm for trunk/src


Ignore:
Timestamp:
2018-06-18T20:29:06+02:00 (13 months ago)
Author:
Don-vip
Message:

use IPrimitive in *CopyActions from PropertiesDialog

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r13941 r13956  
    532532        } else {
    533533            DataSet ds = layerManager.getActiveDataSet();
    534             if (ds == null) return null;
     534            if (ds == null) return Collections.emptyList();
    535535            return ds.getSelected();
    536536        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/AbstractCopyAction.java

    r13849 r13956  
    4646        Set<String> values = new TreeSet<>();
    4747        Collection<? extends Tagged> sel = objectSupplier.get();
    48         if (rows.length == 0 || sel.isEmpty()) return;
     48        if (rows.length == 0 || sel == null || sel.isEmpty()) return;
    4949
    5050        for (int row: rows) {
    5151            String key = keySupplier.apply(row);
    52             if (sel.isEmpty())
    53                 return;
    5452            for (Tagged p : sel) {
    5553                Collection<String> s = getString(p, key);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r13941 r13956  
    6767import org.openstreetmap.josm.data.osm.IRelationMember;
    6868import org.openstreetmap.josm.data.osm.Node;
     69import org.openstreetmap.josm.data.osm.OsmData;
    6970import org.openstreetmap.josm.data.osm.OsmPrimitive;
    7071import org.openstreetmap.josm.data.osm.Relation;
     
    182183    private final PasteValueAction pasteValueAction = new PasteValueAction();
    183184    private final CopyValueAction copyValueAction = new CopyValueAction(
    184             tagTable, editHelper::getDataKey, Main.main::getInProgressSelection);
     185            tagTable, editHelper::getDataKey, Main.main::getInProgressISelection);
    185186    private final CopyKeyValueAction copyKeyValueAction = new CopyKeyValueAction(
    186             tagTable, editHelper::getDataKey, Main.main::getInProgressSelection);
     187            tagTable, editHelper::getDataKey, Main.main::getInProgressISelection);
    187188    private final CopyAllKeyValueAction copyAllKeyValueAction = new CopyAllKeyValueAction(
    188             tagTable, editHelper::getDataKey, Main.main::getInProgressSelection);
     189            tagTable, editHelper::getDataKey, Main.main::getInProgressISelection);
    189190    private final SearchAction searchActionSame = new SearchAction(true);
    190191    private final SearchAction searchActionAny = new SearchAction(false);
     
    650651        membershipTable.setVisible(membershipData.getRowCount() > 0);
    651652
    652         DataSet ds = Main.main.getActiveDataSet();
     653        OsmData<?, ?, ?, ?> ds = MainApplication.getLayerManager().getActiveData();
    653654        boolean isReadOnly = ds != null && ds.isLocked();
    654655        boolean hasSelection = !newSel.isEmpty();
Note: See TracChangeset for help on using the changeset viewer.