Edit control properties and verify controller event handlers in IntelliJ

This commit is contained in:
2026-11-25 08:23:40 +01:00
parent ceb32166ff
commit 22ff06ea75
14 changed files with 699 additions and 16 deletions
@@ -22,7 +22,51 @@ public record BindingMetadata(
List<RepeatOption> tableRows,
List<RepeatOption> tableColumns,
List<String> commandPaths,
List<String> commandTargets) {
List<String> commandTargets,
Optional<List<String>> actionEventHandlers) {
public BindingMetadata(
String model,
String path,
String direction,
List<Attribute> attributes,
List<Target> targets,
List<String> diagnostics,
List<Converter> converters,
List<Problem> problems,
String controller,
String viewModel,
List<Computed> computed,
List<RepeatOption> collections,
List<RepeatOption> components,
List<RepeatOption> panes,
List<RepeatOption> tableCollections,
List<RepeatOption> tableRows,
List<RepeatOption> tableColumns,
List<String> commandPaths,
List<String> commandTargets) {
this(
model,
path,
direction,
attributes,
targets,
diagnostics,
converters,
problems,
controller,
viewModel,
computed,
collections,
components,
panes,
tableCollections,
tableRows,
tableColumns,
commandPaths,
commandTargets,
Optional.empty());
}
public BindingMetadata(
String model,
String path,
@@ -204,6 +248,7 @@ public record BindingMetadata(
tableColumns = List.copyOf(tableColumns);
commandPaths = List.copyOf(commandPaths);
commandTargets = List.copyOf(commandTargets);
actionEventHandlers = actionEventHandlers.map(List::copyOf);
if (!Set.of("view", "model", "both").contains(direction))
throw new IllegalArgumentException("Invalid direction");
}
@@ -211,6 +256,7 @@ public record BindingMetadata(
public Map<String, String> encode() {
var m = new TreeMap<String, String>();
m.put("format", "5");
actionEventHandlers.ifPresent(names -> encodeStrings(m, "actionEvents", names));
encodeStrings(m, "commands", commandPaths);
encodeStrings(m, "commandTargets", commandTargets);
encodeOptions(m, "rc", collections);
@@ -393,6 +439,9 @@ public record BindingMetadata(
decodeOptions(m, "tr"),
decodeOptions(m, "ta"),
commands ? decodeStrings(m, "commands") : List.of(),
commands ? decodeStrings(m, "commandTargets") : List.of());
commands ? decodeStrings(m, "commandTargets") : List.of(),
m.containsKey("actionEvents")
? Optional.of(decodeStrings(m, "actionEvents"))
: Optional.empty());
}
}