Class Label
java.lang.Object
dev.xichil.mvui.Entry
dev.xichil.mvui.Label
Read-only text on its own row: an explanation, a heading, or a value to show. Long text wraps onto several lines.
Label.builder("info")
.text(() -> Text.translatable("mymod.info", "%s profiles saved", profiles.size()))
.build();
Required: text. For the outcome of an action ("Saved", "Failed: …"), use a
StatusLine instead, which has a severity and starts empty.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(EntryVisitor<R> visitor) Calls theEntryVisitormethod for this entry's type (visitButtonfor aButton, …) and returns its result.static Label.BuilderStarts building a label.text()The text shown, from the mod's supplier.
-
Method Details
-
builder
Starts building a label.- Parameters:
id- the label's id, unique within its screen- Returns:
- a new builder
- Throws:
IllegalArgumentException- ifidis invalid
-
text
-
accept
Description copied from class:EntryCalls theEntryVisitormethod for this entry's type (visitButtonfor aButton, …) and returns its result. ASectionvisits as its header, aNumberFieldas itsTextInput.
-