Skip to content

Commit

Permalink
KeyTypeLimit update
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmanusta committed Mar 9, 2024
1 parent d77d994 commit f966de9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/main/java/com/kodedu/config/ShortCutConfigBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,10 @@ public VBox createForm() {
.resourceBundle(ResourceBundle.getBundle("shortcuts"))
.includeAndReorder("disable", "debugMode", "keyTypeLimit", "dumpMode", "filter", "shortcuts")
.build();
ExcludeFilter commentExclusion = new ExcludeFilter("keyTypeLimit");
ExcludeFilter keyTypeLimitExcludeFilter = new ExcludeFilter("keyTypeLimit");
showHideKeyTypeLimit(debugModeProperty().get(), fxForm, keyTypeLimitExcludeFilter);
debugModeProperty().addListener((obs, oldValue, newValue) -> {
if (newValue) {
Platform.runLater(() -> fxForm.getFilters().remove(commentExclusion));
} else {
Platform.runLater(() -> fxForm.addFilters(commentExclusion));
}
showHideKeyTypeLimit(newValue, fxForm, keyTypeLimitExcludeFilter);
});

DefaultFactoryProvider provider = new DefaultFactoryProvider();
Expand Down Expand Up @@ -230,6 +227,14 @@ public VBox createForm() {
return vBox;
}

private static void showHideKeyTypeLimit(Boolean newValue, FXForm fxForm, ExcludeFilter commentExclusion) {
if (newValue) {
Platform.runLater(() -> fxForm.getFilters().remove(commentExclusion));
} else {
Platform.runLater(() -> fxForm.addFilters(commentExclusion));
}
}

@Override
public Path getConfigPath() {
// return Path.of("/Users/usta/projects/AsciidocFX/conf/shortcut_config.json");
Expand Down

0 comments on commit f966de9

Please sign in to comment.