Skip to content

Commit 4d37c24

Browse files
committed
Document packages net.md_5.bungee.api.dialog.action and net.md_5.bungee.api.dialog.body.
1 parent 75456b2 commit 4d37c24

File tree

8 files changed

+57
-1
lines changed

8 files changed

+57
-1
lines changed

dialog/src/main/java/net/md_5/bungee/api/dialog/action/DialogAction.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@
44
import lombok.Data;
55
import net.md_5.bungee.api.chat.BaseComponent;
66

7+
/**
8+
* Represents a dialog action which will usually appear as a button.
9+
*/
710
@Data
811
@AllArgsConstructor
912
public class DialogAction
1013
{
1114

15+
/**
16+
* The text label of the button, mandatory.
17+
*/
1218
private BaseComponent label;
19+
/**
20+
* The hover tooltip of the button.
21+
*/
1322
private BaseComponent tooltip;
23+
/**
24+
* The width of the button (default: 150).
25+
*/
1426
private int width;
1527

1628
public DialogAction(BaseComponent label)

dialog/src/main/java/net/md_5/bungee/api/dialog/action/DialogClickAction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@
88
import net.md_5.bungee.api.chat.BaseComponent;
99
import net.md_5.bungee.api.chat.ClickEvent;
1010

11+
/**
12+
* Represents a button which may be clicked.
13+
*/
1114
@Data
1215
@Accessors(fluent = true)
1316
@ToString(callSuper = true)
1417
@EqualsAndHashCode(callSuper = true)
1518
public class DialogClickAction extends DialogAction
1619
{
1720

21+
/**
22+
* The optional action to take on click.
23+
*/
1824
@SerializedName("on_click")
1925
private ClickEvent onClick;
2026

dialog/src/main/java/net/md_5/bungee/api/dialog/action/DialogSubmitAction.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,25 @@
88
import net.md_5.bungee.api.chat.BaseComponent;
99
import net.md_5.bungee.api.dialog.submit.DialogSubmission;
1010

11+
/**
12+
* Represents a dialog button associated with the submission of a form dialog
13+
* containing inputs.
14+
*/
1115
@Data
1216
@Accessors(fluent = true)
1317
@ToString(callSuper = true)
1418
@EqualsAndHashCode(callSuper = true)
1519
public class DialogSubmitAction extends DialogAction
1620
{
1721

22+
/**
23+
* The ID of the button, used to distinguish submissions initiated via
24+
* different buttons on the dialog.
25+
*/
1826
private String id;
27+
/**
28+
* The submission action to take.
29+
*/
1930
@SerializedName("on_submit")
2031
private DialogSubmission onSubmit;
2132

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* Contains the different actions/buttons for a {@link net.md_5.bungee.api.dialog.Dialog}.
3+
*/
4+
package net.md_5.bungee.api.dialog.action;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
package net.md_5.bungee.api.dialog.body;
22

33
import lombok.Data;
4+
import org.jetbrains.annotations.ApiStatus;
45

6+
/**
7+
* Represents the body content of a {@link net.md_5.bungee.api.dialog.Dialog}.
8+
*/
59
@Data
610
public abstract class DialogBody
711
{
812

13+
/**
14+
* The internal body type.
15+
*/
16+
@ApiStatus.Internal
917
private final String type;
1018
}

dialog/src/main/java/net/md_5/bungee/api/dialog/body/PlainMessageBody.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,23 @@
55
import lombok.ToString;
66
import net.md_5.bungee.api.chat.BaseComponent;
77

8+
/**
9+
* Represents a dialog body which consists of text constrained to a certain
10+
* width.
11+
*/
812
@Data
913
@ToString(callSuper = true)
1014
@EqualsAndHashCode(callSuper = true)
1115
public class PlainMessageBody extends DialogBody
1216
{
1317

18+
/**
19+
* The text body.
20+
*/
1421
private BaseComponent contents;
22+
/**
23+
* The maximum width (default: 200).
24+
*/
1525
private int width;
1626

1727
public PlainMessageBody(BaseComponent contents)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* Contains the different {@link net.md_5.bungee.api.dialog.Dialog} body content
3+
* types.
4+
*/
5+
package net.md_5.bungee.api.dialog.body;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/**
2-
* Contains the core classes for the display of a {@link Dialog}.
2+
* Contains the core classes for the display of a {@link net.md_5.bungee.api.dialog.Dialog}.
33
*/
44
package net.md_5.bungee.api.dialog;

0 commit comments

Comments
 (0)