Package net.storm.api.plugins.config
Annotation Interface ConfigSection
Annotation that defines a collapsible section in the configuration panel.
Sections are used to group related configuration items together in the UI. Each section can be expanded or collapsed by the user, and can optionally start in a collapsed state.
To define a section, annotate a String field in your Config interface:
@ConfigGroup("myplugin")
public interface MyConfig extends Config {
@ConfigSection(
name = "Advanced Settings",
description = "Settings for advanced users",
position = 1,
closedByDefault = true
)
String advancedSection = "Advanced";
@ConfigItem(
keyName = "debugMode",
name = "Debug Mode",
description = "Enable debug logging",
section = "Advanced" // References the section
)
default boolean debugMode() {
return false;
}
}
- See Also:
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionA description of what this section contains.The display name of the section.intThe display position of this section. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether the section should be collapsed by default.booleanWhether this section should be hidden from the UI.The key name for storing the section's collapsed state.The parent section this section belongs to.The key name of a config item that controls this section's visibility.
-
Element Details
-
name
String nameThe display name of the section.- Returns:
- the section title shown in the UI
-
description
String descriptionA description of what this section contains.Displayed as a tooltip when hovering over the section header.
- Returns:
- the section description
-
position
int positionThe display position of this section.Sections are sorted by position in ascending order.
- Returns:
- the position value
-
closedByDefault
boolean closedByDefaultWhether the section should be collapsed by default.When true, users must click to expand the section. When false, the section is expanded initially.
- Returns:
- true if collapsed by default, false otherwise (default)
- Default:
false
-
keyName
String keyNameThe key name for storing the section's collapsed state.If not specified, uses the field name as the key.
- Returns:
- the key name, or empty string to use field name
- Default:
""
-
section
String sectionThe parent section this section belongs to.Allows creating nested sections.
- Returns:
- the parent section field name, or empty string for top-level
- Default:
""
-
unhide
String unhideThe key name of a config item that controls this section's visibility.When the specified item's value is truthy, this section becomes visible.
- Returns:
- the controlling item's key name, or empty string
- Default:
""
-