X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.network.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fui%2Fcontributions%2FChangeMappingTypeHandler.java;h=1f94833507ad557226f249d02740347d995e6eab;hb=a0809b57d402e300f8b5001527e99c89f974bddb;hp=2b3d1888a41b2a0218221444ac8fbf5536f02ce2;hpb=985b0e7fb25091941011286a135731ad44809633;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/ChangeMappingTypeHandler.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/ChangeMappingTypeHandler.java index 2b3d1888..1f948335 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/ChangeMappingTypeHandler.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/ChangeMappingTypeHandler.java @@ -245,18 +245,25 @@ public class ChangeMappingTypeHandler { @Override protected void computeResult() { + Map> currentElements = null; + try { + currentElements = elements.get(); + } catch (InterruptedException | ExecutionException e) { + LOGGER.error("Could not get currentElements", e); + throw new RuntimeException("Could not get currentElements", e); + } for (Map.Entry combos : mappingCombos.entrySet()) { NamedResource resource = combos.getKey(); Combo c = combos.getValue(); String item = c.getItem(c.getSelectionIndex()); - + Collection collection = currentElements.get(resource); Map map = possibleMappings.get(resource); Resource newMapping = map.get(item); results.compute(newMapping, (t, u) -> { if (u == null) { u = new HashSet<>(); } - u.add(resource); + u.addAll(collection); return u; }); }