From 86fed12ac48f750c16efd1311dfae980371725f9 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sat, 12 Feb 2022 12:15:25 +0100 Subject: create annotations --- .../java/io/polyfrost/oneconfig/annotations/Button.java | 14 ++++++++++++++ .../java/io/polyfrost/oneconfig/annotations/Category.java | 12 ++++++++++++ .../io/polyfrost/oneconfig/annotations/ColorPicker.java | 14 ++++++++++++++ .../java/io/polyfrost/oneconfig/annotations/Selector.java | 15 +++++++++++++++ .../java/io/polyfrost/oneconfig/annotations/Slider.java | 15 +++++++++++++++ .../java/io/polyfrost/oneconfig/annotations/Switch.java | 13 +++++++++++++ .../io/polyfrost/oneconfig/annotations/TextField.java | 15 +++++++++++++++ 7 files changed, 98 insertions(+) create mode 100644 src/main/java/io/polyfrost/oneconfig/annotations/Button.java create mode 100644 src/main/java/io/polyfrost/oneconfig/annotations/Category.java create mode 100644 src/main/java/io/polyfrost/oneconfig/annotations/ColorPicker.java create mode 100644 src/main/java/io/polyfrost/oneconfig/annotations/Selector.java create mode 100644 src/main/java/io/polyfrost/oneconfig/annotations/Slider.java create mode 100644 src/main/java/io/polyfrost/oneconfig/annotations/Switch.java create mode 100644 src/main/java/io/polyfrost/oneconfig/annotations/TextField.java (limited to 'src/main/java/io/polyfrost/oneconfig/annotations') diff --git a/src/main/java/io/polyfrost/oneconfig/annotations/Button.java b/src/main/java/io/polyfrost/oneconfig/annotations/Button.java new file mode 100644 index 0000000..98b735f --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/annotations/Button.java @@ -0,0 +1,14 @@ +package io.polyfrost.oneconfig.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Button { + String name(); + String description() default ""; + String text() default "Button"; +} diff --git a/src/main/java/io/polyfrost/oneconfig/annotations/Category.java b/src/main/java/io/polyfrost/oneconfig/annotations/Category.java new file mode 100644 index 0000000..05449dc --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/annotations/Category.java @@ -0,0 +1,12 @@ +package io.polyfrost.oneconfig.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Category { + String name(); +} diff --git a/src/main/java/io/polyfrost/oneconfig/annotations/ColorPicker.java b/src/main/java/io/polyfrost/oneconfig/annotations/ColorPicker.java new file mode 100644 index 0000000..bf997a6 --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/annotations/ColorPicker.java @@ -0,0 +1,14 @@ +package io.polyfrost.oneconfig.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface ColorPicker { + String name(); + String description() default ""; + boolean allowAlpha() default true; +} diff --git a/src/main/java/io/polyfrost/oneconfig/annotations/Selector.java b/src/main/java/io/polyfrost/oneconfig/annotations/Selector.java new file mode 100644 index 0000000..39d238c --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/annotations/Selector.java @@ -0,0 +1,15 @@ +package io.polyfrost.oneconfig.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Selector { + String name(); + String description() default ""; + String[] options(); + int defaultSelection() default 0; +} diff --git a/src/main/java/io/polyfrost/oneconfig/annotations/Slider.java b/src/main/java/io/polyfrost/oneconfig/annotations/Slider.java new file mode 100644 index 0000000..990c70b --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/annotations/Slider.java @@ -0,0 +1,15 @@ +package io.polyfrost.oneconfig.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Slider { + String name(); + String description() default ""; + int min(); + int max(); +} diff --git a/src/main/java/io/polyfrost/oneconfig/annotations/Switch.java b/src/main/java/io/polyfrost/oneconfig/annotations/Switch.java new file mode 100644 index 0000000..fffb490 --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/annotations/Switch.java @@ -0,0 +1,13 @@ +package io.polyfrost.oneconfig.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Switch { + String name(); + String description() default ""; +} diff --git a/src/main/java/io/polyfrost/oneconfig/annotations/TextField.java b/src/main/java/io/polyfrost/oneconfig/annotations/TextField.java new file mode 100644 index 0000000..5761dd6 --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/annotations/TextField.java @@ -0,0 +1,15 @@ +package io.polyfrost.oneconfig.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface TextField { + String name(); + String description() default ""; + String placeholder() default ""; + boolean hideText() default false; +} -- cgit