From a0809b57d402e300f8b5001527e99c89f974bddb Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Fri, 7 Dec 2018 08:51:47 +0200 Subject: [PATCH] Change mapping of elements, not the mapping itself gitlab #22 Change-Id: I93210fdb5c66469c5eb40451435745f23528313f --- .../ui/contributions/ChangeMappingTypeHandler.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; }); } -- 2.47.1