Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2017-01-23 13:22:58 +0000
committerTom Schindl2017-01-23 13:22:58 +0000
commit0cc9021f547b9f2eaf8a7a4291c08ed449c6c109 (patch)
tree898a03d3590d337bde5534b91ea995cf566c9772
parent28d9189a7abc2b65fd014694953df3124613bd91 (diff)
downloadorg.eclipse.efxclipse-0cc9021f547b9f2eaf8a7a4291c08ed449c6c109.tar.gz
org.eclipse.efxclipse-0cc9021f547b9f2eaf8a7a4291c08ed449c6c109.tar.xz
org.eclipse.efxclipse-0cc9021f547b9f2eaf8a7a4291c08ed449c6c109.zip
Bug 510792 - Add support to pass non string types through the command-service
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.di.interopt/src/org/eclipse/fx/ui/di/interopt/CommandServiceImpl.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.workbench.base/src/org/eclipse/fx/ui/workbench/base/internal/CommandServiceImpl.java13
2 files changed, 9 insertions, 7 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.di.interopt/src/org/eclipse/fx/ui/di/interopt/CommandServiceImpl.java b/bundles/runtime/org.eclipse.fx.ui.di.interopt/src/org/eclipse/fx/ui/di/interopt/CommandServiceImpl.java
index ca5f18a1d..2dacdca4f 100644
--- a/bundles/runtime/org.eclipse.fx.ui.di.interopt/src/org/eclipse/fx/ui/di/interopt/CommandServiceImpl.java
+++ b/bundles/runtime/org.eclipse.fx.ui.di.interopt/src/org/eclipse/fx/ui/di/interopt/CommandServiceImpl.java
@@ -98,12 +98,13 @@ public class CommandServiceImpl implements CommandService {
private static Map<@NonNull String, @Nullable Object> mapToString(AdapterService adapterService, @NonNull ObjectSerializer serializer, Map<@NonNull String, @Nullable Object> map) {
Map<@NonNull String, @Nullable Object> rv = new HashMap<>(map);
+
Map<@NonNull String, Object> collect = rv.entrySet()
.stream()
.filter( e -> e.getValue() != null)
.filter( e -> !(e.getValue() instanceof String))
.filter( e -> adapterService.canAdapt(e.getValue(), String.class))
- .collect(Collectors.toMap( e -> e.getKey(), e -> adapterService.adapt(e.getValue(), String.class)));
+ .collect(Collectors.toMap( e -> e.getKey(), e -> (Object)adapterService.adapt(e.getValue(), String.class)));
rv.putAll(collect);
rv.putAll(rv.entrySet().stream()
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.base/src/org/eclipse/fx/ui/workbench/base/internal/CommandServiceImpl.java b/bundles/runtime/org.eclipse.fx.ui.workbench.base/src/org/eclipse/fx/ui/workbench/base/internal/CommandServiceImpl.java
index 8a95e3088..3487294fd 100644
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.base/src/org/eclipse/fx/ui/workbench/base/internal/CommandServiceImpl.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.base/src/org/eclipse/fx/ui/workbench/base/internal/CommandServiceImpl.java
@@ -102,12 +102,13 @@ public class CommandServiceImpl implements CommandService {
@SuppressWarnings("null")
private static Map<@NonNull String, @Nullable Object> mapToString(@NonNull AdapterService adapterService, @NonNull ObjectSerializer serializer, Map<@NonNull String, @Nullable Object> map) {
Map<@NonNull String, @Nullable Object> rv = new HashMap<>(map);
- rv.putAll(rv.entrySet()
- .stream()
- .filter( e -> e.getValue() != null)
- .filter( e -> !(e.getValue() instanceof String))
- .filter( e -> adapterService.canAdapt(e.getValue(), String.class))
- .collect(Collectors.toMap( e -> e.getKey(), e -> adapterService.adapt(e.getValue(), String.class))));
+ Map<@NonNull String, Object> collect = rv.entrySet()
+ .stream()
+ .filter( e -> e.getValue() != null)
+ .filter( e -> !(e.getValue() instanceof String))
+ .filter( e -> adapterService.canAdapt(e.getValue(), String.class))
+ .collect(Collectors.toMap( e -> e.getKey(), e -> (Object)adapterService.adapt(e.getValue(), String.class)));
+ rv.putAll(collect);
rv.putAll(rv.entrySet().stream()
.filter( e -> e.getValue() != null)

Back to the top