Class PluginView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>


  • public class PluginView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    View for Scripts.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull bsh.ConsoleInterface createConsole​(@NotNull java.lang.String name)  
      @Nullable java.util.Map<java.lang.String,​java.lang.Object> getRunValues​(@NotNull Plugin<G,​A,​R> plugin, @NotNull java.awt.Component parent)
      Asks the user for input parameter to run a plugin.
      void setMenu​(@Nullable javax.swing.JMenu menuScripts)
      Set the menu to add script commands to.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PluginView

        public PluginView​(@NotNull
                          @NotNull PluginController<G,​A,​R> pluginController,
                          @NotNull
                          @NotNull PluginModel<G,​A,​R> pluginModel,
                          @NotNull
                          @NotNull PluginParameterViewFactory<G,​A,​R> pluginParameterViewFactory,
                          @NotNull
                          @NotNull ResourceIcons resourceIcons)
        Creates a PluginView.
        Parameters:
        pluginController - controller of this PluginView
        pluginModel - the script model
        resourceIcons - the resource icons for creating icons
        Warning:
        Creating a view from a controller instead of a model is error prone.
    • Method Detail

      • setMenu

        public void setMenu​(@Nullable
                            @Nullable javax.swing.JMenu menuScripts)
        Set the menu to add script commands to. Entries already present in the menu are deleted.
        Parameters:
        menuScripts - the plugins menu
      • createConsole

        @NotNull
        public @NotNull bsh.ConsoleInterface createConsole​(@NotNull
                                                           @NotNull java.lang.String name)
      • getRunValues

        @Nullable
        public @Nullable java.util.Map<java.lang.String,​java.lang.Object> getRunValues​(@NotNull
                                                                                             @NotNull Plugin<G,​A,​R> plugin,
                                                                                             @NotNull
                                                                                             @NotNull java.awt.Component parent)
        Asks the user for input parameter to run a plugin.
        Parameters:
        plugin - the plugin
        parent - the parent component for dialogs
        Returns:
        the input parameters or null to not run the plugin