Enable programmatically referencing Component's components

This commit is contained in:
2022-08-25 18:37:12 +02:00
parent 7d8848c6e5
commit 54b0c9b4b9
21 changed files with 192 additions and 153 deletions

View File

@@ -233,7 +233,7 @@ public class DefaultInflater implements Inflater {
@SneakyThrows
private Component createComponent(Class<? extends Widget> componentClass, NamedNodeMap attributes, Map<String, Component> refs, Context context, GUI gui) {
var component = (Component) componentClass.getConstructor(Context.class, GUI.class).newInstance(context, gui);
var component = (Component) componentClass.getConstructor(Context.class, GUI.class, Map.class).newInstance(context, gui, refs);
// Set attributes via setter methods
for (int i = 0; i < attributes.getLength(); ++i) {