Skip to content

Commit 292416a

Browse files
javier-godoypaodb
authored andcommitted
refactor: use JsonMigration helper
1 parent a7b75f4 commit 292416a

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@
9696
<version>1.2.0</version>
9797
</dependency>
9898

99+
<dependency>
100+
<groupId>com.flowingcode.vaadin</groupId>
101+
<artifactId>json-migration-helper</artifactId>
102+
<version>0.0.1-SNAPSHOT</version>
103+
</dependency>
104+
99105
<dependency>
100106
<groupId>junit</groupId>
101107
<artifactId>junit</artifactId>

src/main/java/com/flowingcode/vaadin/addons/demo/MultiSourceCodeViewer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* Commons Demo
44
* %%
5-
* Copyright (C) 2020 - 2024 Flowing Code
5+
* Copyright (C) 2020 - 2025 Flowing Code
66
* %%
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
package com.flowingcode.vaadin.addons.demo;
2121

2222
import com.flowingcode.vaadin.addons.enhancedtabs.EnhancedTabs;
23+
import com.flowingcode.vaadin.jsonmigration.JsonMigration;
2324
import com.vaadin.flow.component.ComponentUtil;
2425
import com.vaadin.flow.component.html.Div;
2526
import com.vaadin.flow.component.tabs.Tab;
@@ -46,7 +47,8 @@ public MultiSourceCodeViewer(List<SourceCodeTab> sourceCodeTabs, Map<String, Str
4647
selectedTab = tabs.getSelectedTab();
4748

4849
getElement().addEventListener("fragment-request", ev -> {
49-
JsonValue filename = ev.getEventData().get("event.detail.filename");
50+
JsonValue filename =
51+
JsonMigration.convertToJsonValue(ev.getEventData().get("event.detail.filename"));
5052
findTabWithFilename(Optional.ofNullable(filename).map(JsonValue::asString).orElse(null))
5153
.ifPresent(tab -> {
5254
tabs.setSelectedTab(tab);

src/main/java/com/flowingcode/vaadin/addons/demo/SourceCodeViewer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* Commons Demo
44
* %%
5-
* Copyright (C) 2020 - 2024 Flowing Code
5+
* Copyright (C) 2020 - 2025 Flowing Code
66
* %%
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
package com.flowingcode.vaadin.addons.demo;
2121

2222
import com.flowingcode.vaadin.addons.DevSourceRequestHandler;
23+
import com.flowingcode.vaadin.jsonmigration.JsonMigration;
2324
import com.vaadin.flow.component.ClickNotifier;
2425
import com.vaadin.flow.component.Component;
2526
import com.vaadin.flow.component.HasElement;
@@ -85,7 +86,7 @@ private void setProperties(Map<String, String> properties) {
8586
env.put(k, Json.create(v));
8687
}
8788
});
88-
codeViewer.setPropertyJson("env", env);
89+
JsonMigration.setPropertyJson(codeViewer, "env", env);
8990
}
9091
}
9192

0 commit comments

Comments
 (0)