Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import lombok.experimental.ExtensionMethod;

@ExtensionMethod(value = JsonMigration.class, suppressBaseMethods = true)
public class MultiSourceCodeViewer extends Div {

private static final String DATA_URL = "source-url";
Expand All @@ -47,7 +49,7 @@ public MultiSourceCodeViewer(List<SourceCodeTab> sourceCodeTabs, Map<String, Str
selectedTab = tabs.getSelectedTab();

getElement().addEventListener("fragment-request", ev -> {
JsonValue filename = JsonMigration.getEventData(ev).get("event.detail.filename");
JsonValue filename = ev.getEventData().get("event.detail.filename");
findTabWithFilename(Optional.ofNullable(filename).map(JsonValue::asString).orElse(null))
.ifPresent(tab -> {
tabs.setSelectedTab(tab);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
import elemental.json.Json;
import elemental.json.JsonObject;
import java.util.Map;
import lombok.experimental.ExtensionMethod;

@SuppressWarnings("serial")
@JsModule("./code-viewer.ts")
@ExtensionMethod(value = JsonMigration.class, suppressBaseMethods = true)
public class SourceCodeViewer extends Div implements HasSize {

private final Element codeViewer;
Expand Down Expand Up @@ -86,7 +88,7 @@ private void setProperties(Map<String, String> properties) {
env.put(k, Json.create(v));
}
});
JsonMigration.setPropertyJson(codeViewer, "env", env);
codeViewer.setPropertyJson("env", env);
}
}

Expand Down