Interface DialogActionBuilder<D extends Dialog<?,?,?,?>,T extends DialogActionBuilder<D,T>>
- Type Parameters:
D
- the type of the base dialogT
- the type of the implementing class, allowing for method chaining
- All Known Subinterfaces:
AdventureDialogActionBuilder<D,
T>
- All Known Implementing Classes:
PaperDialogActionBuilder
,PEDialogActionBuilder
,SpigotDialogActionBuilder
public interface DialogActionBuilder<D extends Dialog<?,?,?,?>,T extends DialogActionBuilder<D,T>>
Interface for building dialog actions.
This interface provides methods to set various properties of a dialog action,
such as label, tooltip, width, and different types of actions like copying to clipboard,
running commands, and opening URLs.
It is designed to be implemented by classes that build specific types of dialog actions.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncopyToClipboard
(String value) Set the action to be a copy-to-clipboard actiondynamicCustom
(String id) Set the action to be a dynamic custom actiondynamicCustom
(String namespace, String id) Set the action to be a dynamic custom action with a namespacedynamicRunCommand
(String template) Set the action to be a dynamic run command actionSet the label for the dialog actionSet the action to be an open-URL actionrunCommand
(String command) Set the action to be a run command actionshowDialog
(D dialog) Set the action to be a show dialog actionshowDialog
(DialogOpener dialogOpener) Set the action to be a show dialog actionshowDialog
(String namespace, String dialogId) Set the action to be a show dialog actionsuggestCommand
(String command) Set the action to be a suggest command actionSet the tooltip for the dialog actionwidth
(int width) Set the width for the dialog action
-
Field Details
-
DEFAULT_WIDTH
static final int DEFAULT_WIDTH- See Also:
-
-
Method Details
-
label
Set the label for the dialog action- Parameters:
label
- the label to set- Returns:
- the current instance of the builder for method chaining
-
tooltip
Set the tooltip for the dialog action- Parameters:
tooltip
- the tooltip to set, can be null- Returns:
- the current instance of the builder for method chaining
-
width
Set the width for the dialog action- Parameters:
width
- the width to set- Returns:
- the current instance of the builder for method chaining
-
copyToClipboard
Set the action to be a copy-to-clipboard action- Parameters:
value
- the value to copy to the clipboard- Returns:
- the current instance of the builder for method chaining
-
dynamicCustom
Set the action to be a dynamic custom action- Parameters:
id
- the identifier for the dynamic custom action- Returns:
- the current instance of the builder for method chaining
-
dynamicCustom
Set the action to be a dynamic custom action with a namespace- Parameters:
namespace
- the namespace for the dynamic custom actionid
- the identifier for the dynamic custom action- Returns:
- the current instance of the builder for method chaining
-
dynamicRunCommand
Set the action to be a dynamic run command action- Parameters:
template
- the command template to run- Returns:
- the current instance of the builder for method chaining
-
openUrl
Set the action to be an open-URL action- Parameters:
url
- the URL to open- Returns:
- the current instance of the builder for method chaining
-
runCommand
Set the action to be a run command action- Parameters:
command
- the command to run- Returns:
- the current instance of the builder for method chaining
-
suggestCommand
Set the action to be a suggest command action- Parameters:
command
- the command to suggest- Returns:
- the current instance of the builder for method chaining
-
showDialog
Set the action to be a show dialog action- Parameters:
dialog
- the dialog to show- Returns:
- the current instance of the builder for method chaining
-
showDialog
Set the action to be a show dialog action- Parameters:
namespace
- the namespace of the dialogdialogId
- the identifier of the dialog to show- Returns:
- the current instance of the builder for method chaining
-
showDialog
Set the action to be a show dialog action- Parameters:
dialogOpener
- the dialog opener to use for showing the dialog- Returns:
- the current instance of the builder for method chaining
-