aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/config/annotations/Option.java
blob: 9955c1793c6013f4f8aef52e96d20342a100c15a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package io.polyfrost.oneconfig.config.annotations;

import io.polyfrost.oneconfig.config.data.InfoType;
import io.polyfrost.oneconfig.config.data.OptionType;

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 Option {
    /**
     * The name of the option that will be displayed to the user
     */
    String name();

    /**
     * The type of the option
     */
    OptionType type();

    /**
     * The category of the component
     */
    String category() default "General";

    /**
     * The subcategory of the component (displayed as header)
     */
    String subcategory();

    /**
     * The width of the option (1 = half width, 2 = full width)
     */
    int size() default 1;

    /**
     * A String array of all the possible values for the UniSelector, dropdownList, and ComboBox.
     * Also used in the DualOption slider, index 0 is the left, index 1 is the right; for example:
     * {"Option 1", "Option 2"}
     */
    String[] options() default {};

    /**
     * The places you want dividers to be in a dropdown
     */
    int[] dividers() default {};

    /**
     * The placeholder in the text field
     */
    String placeholder() default "";

    /**
     * If the text field is secure or not
     */
    boolean secure() default false;

    /**
     * If the text field is multi line or not
     */
    boolean multiLine() default false;

    /**
     * Minimum value of slider
     */
    float min() default 0;

    /**
     * The maximum value of the slider
     */
    float max() default 0;

    /**
     * Steps of slider (0 for no steps)
     */
    int step() default 0;

    /**
     * Option for info option type
     */
    InfoType infoType() default InfoType.INFO;
}