Interface GuiEditor
- All Known Subinterfaces:
BindCaptureEditor, ChoiceEditor, ConfirmEditor, DualListEditor, FormEditor, ListEditor, MacroEditor, NoticeEditor, NumberEditor, PickerEditor, StaticColorEditor, TuneEditor
public sealed interface GuiEditor
permits ListEditor, DualListEditor, PickerEditor, NumberEditor, StaticColorEditor, ChoiceEditor, FormEditor, MacroEditor, TuneEditor, ConfirmEditor, NoticeEditor, BindCaptureEditor
An editor (popup): what it edits and what its controls do, without any drawing. Views draw an
editor and call into it; typing is handled here so every theme types the same way.
There is one sub-interface per kind of editor, so a view picks its layout with a switch:
There is one sub-interface per kind of editor, so a view picks its layout with a switch:
switch (editor) { case ListEditor list -> ...; case FormEditor form -> ...; }. Addons
create editors with GuiEditors.-
Method Summary
Modifier and TypeMethodDescriptionbooleancharTyped(GuiCharEvent event) voidclose()Removes this editor and every editor above it.id()booleankeyPressed(GuiKeyEvent event) Handles a key while this editor is on top: typing into its fields, Enter, Tab and paste.title()
-
Method Details
-
id
String id()- Returns:
- Stable id naming what is edited, for example
boze:block-listorboze:presets, so a theme can give one editor its own view
-
title
String title() -
keyPressed
Handles a key while this editor is on top: typing into its fields, Enter, Tab and paste.- Returns:
- Whether the key was used
-
charTyped
- Returns:
- Whether the character was used
-
close
void close()Removes this editor and every editor above it.
-