Author HTML and typed suggestion bindings in the IntelliJ designer
This commit is contained in:
@@ -94,12 +94,43 @@ public final class SavedDocumentTargetProbe {
|
||||
popup(dynamic, "Re", List.of("Rechnung", "Reise"));
|
||||
fx(
|
||||
() -> {
|
||||
var tags = tagSource();
|
||||
dynamic.setText("R");
|
||||
tags.add("Register");
|
||||
var choices =
|
||||
Window.getWindows().stream()
|
||||
.filter(w -> w instanceof Popup && w.isShowing())
|
||||
.map(w -> (ListView<?>) w.getScene().lookup(".list-view"))
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst()
|
||||
.orElseThrow();
|
||||
require(
|
||||
choices.getItems().equals(List.of("Rechnung", "Reise", "Register")),
|
||||
"addition in open popup");
|
||||
tags.remove("Reise");
|
||||
require(
|
||||
choices.getItems().equals(List.of("Rechnung", "Register")),
|
||||
"removal in open popup");
|
||||
dynamic.fireEvent(
|
||||
new KeyEvent(
|
||||
KeyEvent.KEY_PRESSED, "", "", KeyCode.DOWN, false, false, false, false));
|
||||
dynamic.fireEvent(
|
||||
new KeyEvent(
|
||||
KeyEvent.KEY_PRESSED, "", "", KeyCode.ENTER, false, false, false, false));
|
||||
require(
|
||||
dynamic.getText().equals("Rechnung")
|
||||
&& tags.equals(List.of("Rechnung", "Register")),
|
||||
"pick leaves catalogue intact");
|
||||
dynamic.setText("Re");
|
||||
((Button) root.lookup("#next")).fire();
|
||||
require(
|
||||
Window.getWindows().stream().noneMatch(w -> w instanceof Popup && w.isShowing()),
|
||||
"old matches dismissed on replacement");
|
||||
return null;
|
||||
});
|
||||
body("Lieferschein LS-018");
|
||||
require(
|
||||
fx(() -> suggestions(dynamic).equals(List.of("Lieferung", "Lieferschein"))),
|
||||
fx(() -> tagSource().equals(List.of("Lieferung", "Lieferschein"))),
|
||||
"replacement removes old document tags");
|
||||
popup(dynamic, "Li", List.of("Lieferung", "Lieferschein"));
|
||||
popup(fixed, "Pr", List.of("Prüfung", "Privat"));
|
||||
@@ -157,8 +188,9 @@ public final class SavedDocumentTargetProbe {
|
||||
});
|
||||
}
|
||||
|
||||
private List<?> suggestions(TextField field) throws Exception {
|
||||
return (List<?>) field.getClass().getMethod("getSuggestions").invoke(field);
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<String> tagSource() throws Exception {
|
||||
return (List<String>) dynamic.getClass().getMethod("getSuggestionsSource").invoke(dynamic);
|
||||
}
|
||||
|
||||
private void popup(TextField field, String prefix, List<String> expected) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user