Class PluginController<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.dialog.plugin.PluginController<G,A,R>
-
- All Implemented Interfaces:
EditorAction
public class PluginController<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements EditorAction
Controller for plugins.- Todo:
- documentation
-
-
Constructor Summary
Constructors Constructor Description PluginController(@NotNull FilterControl<G,A,R> filterControl, @NotNull PluginModel<G,A,R> pluginModel, @NotNull PluginParameters pluginParameters, @NotNull java.awt.Component parent, @NotNull PluginParameterViewFactory<G,A,R> pluginParameterViewFactory, @NotNull java.io.File pluginsDir, @NotNull ResourceIcons resourceIcons)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExit()Prompts the user for all unsaved plugins.@NotNull javax.swing.ActioncreateRunAction(@NotNull Plugin<G,A,R> plugin)Creates an action to run a plugin plugin.@NotNull PluginView<G,A,R>getView()voidrunPlugin(@NotNull java.lang.String name)voidrunPlugin(@NotNull Plugin<G,A,R> plugin)voidsaveAllPlugins()Saves all modified plugins.booleansavePluginAs(@NotNull Plugin<G,A,R> plugin, boolean updatePluginFile)Prompts the user for a file name to save a plugin.voidsetAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)Sets theActioninstance for this editor action.
-
-
-
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 saveupdatePluginFile- if set, update the plugin file to the save location- Returns:
- whether the plugin has been saved
-
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:EditorActionSets theActioninstance for this editor action.- Specified by:
setActionin interfaceEditorAction- Parameters:
action- the action instancename- the name of the action
-
-