Skip to content

Commit

Permalink
feat: smc fileDiff 集成 userData功能 (#193)
Browse files Browse the repository at this point in the history
Signed-off-by: unknowIfGuestInDream <tang97155@163.com>
  • Loading branch information
unknowIfGuestInDream committed Jan 4, 2023
1 parent e0a3a25 commit 87cf5c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions smc/src/main/java/com/tlcsdm/smc/tools/FileDiff.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class FileDiff extends SmcSample {
webView.getEngine().loadContent(template);
notificationBuilder.text(I18nUtils.get("smc.tool.fileDiff.button.generate.success"));
notificationBuilder.showInformation();
bindUserData();
});

private final Action download = new Action(I18nUtils.get("smc.tool.button.download"), actionEvent -> {
Expand All @@ -64,6 +65,7 @@ public class FileDiff extends SmcSample {
DiffHandleUtils.generateDiffHtml(diffString, outputField.getText() + "\\diff.html");
notificationBuilder.text(I18nUtils.get("smc.tool.fileDiff.button.download.success"));
notificationBuilder.showInformation();
bindUserData();
});

private final Collection<? extends Action> actions = List.of(generate, download);
Expand Down Expand Up @@ -144,6 +146,10 @@ public Node getPanel(Stage stage) {
webView.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
GridPane.setVgrow(webView, Priority.ALWAYS);

userData.put("original", originalField);
userData.put("compare", compareField);
userData.put("output", outputField);

grid.add(toolBar, 0, 0, 3, 1);
grid.add(originalLabel, 0, 1);
grid.add(originalButton, 1, 1);
Expand Down

0 comments on commit 87cf5c5

Please sign in to comment.