Document packages net.md_5.bungee.api.dialog.action and net.md_5.bungee.api.dialog.body.
This commit is contained in:
parent
75456b2c0a
commit
4d37c2488e
@ -4,13 +4,25 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a dialog action which will usually appear as a button.
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DialogAction
|
public class DialogAction
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The text label of the button, mandatory.
|
||||||
|
*/
|
||||||
private BaseComponent label;
|
private BaseComponent label;
|
||||||
|
/**
|
||||||
|
* The hover tooltip of the button.
|
||||||
|
*/
|
||||||
private BaseComponent tooltip;
|
private BaseComponent tooltip;
|
||||||
|
/**
|
||||||
|
* The width of the button (default: 150).
|
||||||
|
*/
|
||||||
private int width;
|
private int width;
|
||||||
|
|
||||||
public DialogAction(BaseComponent label)
|
public DialogAction(BaseComponent label)
|
||||||
|
@ -8,6 +8,9 @@ import lombok.experimental.Accessors;
|
|||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a button which may be clicked.
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(fluent = true)
|
@Accessors(fluent = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@ -15,6 +18,9 @@ import net.md_5.bungee.api.chat.ClickEvent;
|
|||||||
public class DialogClickAction extends DialogAction
|
public class DialogClickAction extends DialogAction
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The optional action to take on click.
|
||||||
|
*/
|
||||||
@SerializedName("on_click")
|
@SerializedName("on_click")
|
||||||
private ClickEvent onClick;
|
private ClickEvent onClick;
|
||||||
|
|
||||||
|
@ -8,6 +8,10 @@ import lombok.experimental.Accessors;
|
|||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.api.dialog.submit.DialogSubmission;
|
import net.md_5.bungee.api.dialog.submit.DialogSubmission;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a dialog button associated with the submission of a form dialog
|
||||||
|
* containing inputs.
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(fluent = true)
|
@Accessors(fluent = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@ -15,7 +19,14 @@ import net.md_5.bungee.api.dialog.submit.DialogSubmission;
|
|||||||
public class DialogSubmitAction extends DialogAction
|
public class DialogSubmitAction extends DialogAction
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ID of the button, used to distinguish submissions initiated via
|
||||||
|
* different buttons on the dialog.
|
||||||
|
*/
|
||||||
private String id;
|
private String id;
|
||||||
|
/**
|
||||||
|
* The submission action to take.
|
||||||
|
*/
|
||||||
@SerializedName("on_submit")
|
@SerializedName("on_submit")
|
||||||
private DialogSubmission onSubmit;
|
private DialogSubmission onSubmit;
|
||||||
|
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* Contains the different actions/buttons for a {@link net.md_5.bungee.api.dialog.Dialog}.
|
||||||
|
*/
|
||||||
|
package net.md_5.bungee.api.dialog.action;
|
@ -1,10 +1,18 @@
|
|||||||
package net.md_5.bungee.api.dialog.body;
|
package net.md_5.bungee.api.dialog.body;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.jetbrains.annotations.ApiStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the body content of a {@link net.md_5.bungee.api.dialog.Dialog}.
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
public abstract class DialogBody
|
public abstract class DialogBody
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The internal body type.
|
||||||
|
*/
|
||||||
|
@ApiStatus.Internal
|
||||||
private final String type;
|
private final String type;
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,23 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a dialog body which consists of text constrained to a certain
|
||||||
|
* width.
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class PlainMessageBody extends DialogBody
|
public class PlainMessageBody extends DialogBody
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The text body.
|
||||||
|
*/
|
||||||
private BaseComponent contents;
|
private BaseComponent contents;
|
||||||
|
/**
|
||||||
|
* The maximum width (default: 200).
|
||||||
|
*/
|
||||||
private int width;
|
private int width;
|
||||||
|
|
||||||
public PlainMessageBody(BaseComponent contents)
|
public PlainMessageBody(BaseComponent contents)
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
/**
|
||||||
|
* Contains the different {@link net.md_5.bungee.api.dialog.Dialog} body content
|
||||||
|
* types.
|
||||||
|
*/
|
||||||
|
package net.md_5.bungee.api.dialog.body;
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* Contains the core classes for the display of a {@link Dialog}.
|
* Contains the core classes for the display of a {@link net.md_5.bungee.api.dialog.Dialog}.
|
||||||
*/
|
*/
|
||||||
package net.md_5.bungee.api.dialog;
|
package net.md_5.bungee.api.dialog;
|
||||||
|
Loading…
Reference in New Issue
Block a user