Package su.onno.annotations
Annotation Interface EnumLabel
Human-facing display label for a single
@Enumeration constant, distinct from the Java
constant name. Put it on the constant to localize or pretty-print the value
(e.g. @EnumLabel("Новый") NEW) without renaming the constant — the name stays
part of the data/API contract (it derives the value's stable UUID and is mirrored by importers
and list filters), while the label is what users see.
Surfaces wherever an enum value is displayed: {column}_display in the read API, the
label of each entry in an attribute's enumValues metadata, and the form dropdown.
When absent (or empty), the display falls back to the constant name.
An optional color() paints the value as a colored pill — a status chip the colour of
the spreadsheet cell it replaces — in list cells, the form dropdown, and the detail view. It rides
the read API as {column}_color (next to {column}_display) and the color of
each enumValues entry; the client derives a readable (dark/light) text colour from it. When
absent the value renders as plain text, exactly as before.
@Enumeration(name = "OrderStatuses", title = "Статусы заказов")
public enum OrderStatus {
@EnumLabel(value = "Новый", color = "#F4C7C3") NEW,
@EnumLabel(value = "Отгружен", color = "#0B8043") SHIPPED
}
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements