Class InfoExecutable

java.lang.Object
net.regsirius06.engine.utils.help.InfoExecutable
All Implemented Interfaces:
Executable, Loadable
Direct Known Subclasses:
Help

public abstract class InfoExecutable extends Object implements Executable
An abstract class that provides a base implementation for creating an "About" informational dialog for plugins. This class implements the Executable interface, providing the logic for displaying information about the plugin, including details like its description, version, authors, dependencies, and contribution instructions.

The execute() method shows a modal dialog containing formatted information about the plugin, while the actual content (description, version, authors, etc.) must be provided by subclasses through abstract methods.

This class is particularly useful for adding an "About" button to a plugin, allowing users to view detailed information about the plugin when clicked.

See Also:
  • Constructor Details

    • InfoExecutable

      public InfoExecutable()
  • Method Details

    • name

      public String name()
      Returns the name of this executable task.

      The name is used to identify this executable within the system. For the InfoExecutable class, the name will always be "About", as it is specifically for displaying plugin information.

      Specified by:
      name in interface Executable
      Returns:
      the name of the executable task ("About")
    • execute

      public void execute()
      Executes the task of displaying the plugin information in a dialog box.

      This method creates and shows a dialog with information about the plugin, including details such as description, version, authors, dependencies, and contribution instructions.

      The content of the dialog is populated using the abstract methods defined in this class, which must be implemented by subclasses to provide the actual plugin-specific information.

      Specified by:
      execute in interface Executable
      See Also:
    • authors

      protected abstract List<String> authors()
      Returns the authors of the plugin.

      This method must be implemented by subclasses to return the list of authors of the plugin.

      Returns:
      a list of authors
    • description

      protected abstract String description()
      Returns the description of the plugin.

      This method must be implemented by subclasses to return a description of the plugin.

      Returns:
      a description of the plugin
    • version

      protected abstract String version()
      Returns the version of the plugin.

      This method must be implemented by subclasses to return the version of the plugin.

      Returns:
      the version of the plugin
    • dependencies

      protected abstract List<String> dependencies()
      Returns the dependencies of the plugin.

      This method must be implemented by subclasses to return the list of dependencies of the plugin.

      Returns:
      a list of dependencies
    • contribute

      protected abstract String contribute()
      Returns the contribution instructions for the plugin.

      This method must be implemented by subclasses to return the contribution guidelines for the plugin.

      Returns:
      the contribution instructions for the plugin