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
Constructor and 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.
|
Modifier and Type | Method and 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 Plugin<G,A,R> plugin) |
void |
runPlugin(@NotNull java.lang.String name) |
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. |
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)
public boolean canExit()
public void saveAllPlugins()
public boolean savePluginAs(@NotNull @NotNull Plugin<G,A,R> plugin, boolean updatePluginFile)
plugin
- the plugin to saveupdatePluginFile
- if set, update the plugin file to the save
location@ActionMethod public void runPlugin(@NotNull @NotNull java.lang.String name)
@NotNull public @NotNull PluginView<G,A,R> getView()
@NotNull public @NotNull javax.swing.Action createRunAction(@NotNull @NotNull Plugin<G,A,R> plugin)
plugin
- the plugin to runpublic void setAction(@NotNull @NotNull javax.swing.Action action, @NotNull @NotNull java.lang.String name)
EditorAction
Action
instance for this editor action.setAction
in interface EditorAction
action
- the action instancename
- the name of the action