Package org.cloudburstmc.server.form
Class Form.FormBuilder<F extends Form<R>,T extends Form.FormBuilder<F,T,R>,R>
java.lang.Object
org.cloudburstmc.server.form.Form.FormBuilder<F,T,R>
- Direct Known Subclasses:
CustomForm.CustomFormBuilder,ModalForm.ModalFormBuilder,SimpleForm.SimpleFormBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<Consumer<CloudPlayer>>protected List<Consumer<CloudPlayer>>protected List<BiConsumer<CloudPlayer,R>>protected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Fbuild()onClose(Consumer<CloudPlayer> listener)Called when the form is closedonError(Consumer<CloudPlayer> listener)Called when an error occurs during the response processing That could be caused either by a plugin or wrong response (which shouldn't occur in case of vanilla client)onSubmit(BiConsumer<CloudPlayer,R> listener)Called when the form is successfully submittedprotected abstract Tself()Set a title of the form
-
Field Details
-
title
-
listeners
-
closeListeners
-
errorListeners
-
-
Constructor Details
-
FormBuilder
public FormBuilder()
-
-
Method Details
-
title
Set a title of the form- Parameters:
title- form title- Returns:
- self builder instance
-
onSubmit
Called when the form is successfully submitted- Parameters:
listener- callback function- Returns:
- builder instance
-
onClose
Called when the form is closed- Parameters:
listener- callback function- Returns:
- builder instance
-
onError
Called when an error occurs during the response processing That could be caused either by a plugin or wrong response (which shouldn't occur in case of vanilla client)- Parameters:
listener- callback function- Returns:
- builder instance
-
build
- Returns:
- a new Form instance of given generic type
-
self
-