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

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canExit()
      Prompts the user for all unsaved plugins.
      @NotNull javax.swing.Action createRunAction​(@NotNull Plugin<G,​A,​R> plugin)
      Creates an action to run a plugin plugin.
      @NotNull PluginView<G,​A,​R> getView()  
      void runPlugin​(@NotNull java.lang.String name)  
      void runPlugin​(@NotNull Plugin<G,​A,​R> plugin)  
      void saveAllPlugins()
      Saves all modified plugins.
      boolean savePluginAs​(@NotNull Plugin<G,​A,​R> plugin, boolean updatePluginFile)
      Prompts the user for a file name to save a plugin.
      void setAction​(@NotNull javax.swing.Action action, @NotNull java.lang.String name)
      Sets the Action instance for this editor action.
      • Methods inherited from class java.lang.Object

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

      • PluginController

        public PluginController​(@NotNull
                                @NotNull FilterControl<G,​A,​R> filterControl,
                                @NotNull
                                @NotNull PluginModel<G,​A,​R> pluginModel,
                                @NotNull
                                @NotNull PluginParameters pluginParameters,
                                @NotNull
                                @NotNull java.awt.Component parent,
                                @NotNull
                                @NotNull PluginParameterViewFactory<G,​A,​R> pluginParameterViewFactory,
                                @NotNull
                                @NotNull java.io.File pluginsDir,
                                @NotNull
                                @NotNull ResourceIcons resourceIcons)
        Creates a new instance.
    • Method Detail

      • canExit

        public boolean canExit()
        Prompts the user for all unsaved plugins.
        Returns:
        whether no unsaved plugins remain
      • saveAllPlugins

        public void saveAllPlugins()
        Saves all modified plugins. Does nothing if all plugins are unchanged.
      • savePluginAs

        public boolean savePluginAs​(@NotNull
                                    @NotNull Plugin<G,​A,​R> plugin,
                                    boolean updatePluginFile)
        Prompts the user for a file name to save a plugin. The plugin is saved regardless whether the plugin is modified or not.
        Parameters:
        plugin - the plugin to save
        updatePluginFile - if set, update the plugin file to the save location
        Returns:
        whether the plugin has been saved
      • runPlugin

        public void runPlugin​(@NotNull
                              @NotNull Plugin<G,​A,​R> plugin)
      • runPlugin

        @ActionMethod
        public void runPlugin​(@NotNull
                              @NotNull java.lang.String name)
      • getView

        @NotNull
        public @NotNull PluginView<G,​A,​R> getView()
      • createRunAction

        @NotNull
        public @NotNull javax.swing.Action createRunAction​(@NotNull
                                                           @NotNull Plugin<G,​A,​R> plugin)
        Creates an action to run a plugin plugin.
        Parameters:
        plugin - the plugin to run
        Returns:
        the action
      • setAction

        public void setAction​(@NotNull
                              @NotNull javax.swing.Action action,
                              @NotNull
                              @NotNull java.lang.String name)
        Description copied from interface: EditorAction
        Sets the Action instance for this editor action.
        Specified by:
        setAction in interface EditorAction
        Parameters:
        action - the action instance
        name - the name of the action