From be87f006afb8f224afe57950d1b72cb4117a5835 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 8 Aug 2019 14:58:05 +0200 Subject: Refactor GUIBuilderConfiguration to support Map and List based property format --- .../gv/egiz/eaaf/core/api/gui/GroupDefinition.java | 34 ++++++++++++++++++++++ .../api/gui/ModifyableGuiBuilderConfiguration.java | 4 +-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/GroupDefinition.java (limited to 'eaaf_core_api') diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/GroupDefinition.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/GroupDefinition.java new file mode 100644 index 00000000..441f1917 --- /dev/null +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/GroupDefinition.java @@ -0,0 +1,34 @@ +package at.gv.egiz.eaaf.core.api.gui; + +public class GroupDefinition { + + private final String name; + private final TYPE type; + + private GroupDefinition(String name, TYPE type) { + this.name = name; + this.type = type; + } + + public static GroupDefinition getInstance(String name, TYPE type) { + return new GroupDefinition(name, type); + } + + public String getName() { + return name; + } + + public TYPE getType() { + return type; + } + + public enum TYPE { + LIST("list"), + MAP("map"); + + private TYPE(String type) { + } + } + +} + diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/ModifyableGuiBuilderConfiguration.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/ModifyableGuiBuilderConfiguration.java index 19fe9a12..6df6a78f 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/ModifyableGuiBuilderConfiguration.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/ModifyableGuiBuilderConfiguration.java @@ -39,7 +39,7 @@ public interface ModifyableGuiBuilderConfiguration { * @param key velocity context key * @param value of this key */ - void putCustomParameterWithOutEscaption(@Nullable String group, @Nonnull String key, @Nonnull Object value); + void putCustomParameterWithOutEscaption(@Nullable GroupDefinition group, @Nonnull String key, @Nonnull Object value); /** * Add a key/value pair into Velocity context.
@@ -49,6 +49,6 @@ public interface ModifyableGuiBuilderConfiguration { * @param key velocity context key * @param value of this key */ - void putCustomParameter(@Nullable String group, @Nonnull String key, @Nonnull String value); + void putCustomParameter(@Nullable GroupDefinition group, @Nonnull String key, @Nonnull String value); } \ No newline at end of file -- cgit v1.2.3