Class PluginContextFactory
- java.lang.Object
-
- ca.cgjennings.apps.arkham.plugins.PluginContextFactory
-
public final class PluginContextFactory extends java.lang.Object
A factory forPluginContext
instances.- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PluginContext
createContext(AbstractInstalledPlugin ip, int modifiers)
Creates a plug-in context for the plug-in currently managed by the specified installed plug-in instance.static PluginContext
createContext(Plugin plugin, int modifiers)
Creates a context for a plug-in.static PluginContext
createDummyContext()
Returns a dummy context.static PluginContext
createDummyContext(int modifiers)
Returns a dummy context.static PluginContext
createProbeContext(AbstractInstalledPlugin ip, Plugin p)
Creates a plug-in context suitable for probing the plug-in currently managed by the specified installed plug-in instance.static PluginContext
createProbeContext(Plugin plugin)
Creates a context suitable for probing a plug-in.
-
-
-
Method Detail
-
createContext
public static PluginContext createContext(AbstractInstalledPlugin ip, int modifiers) throws PluginException
Creates a plug-in context for the plug-in currently managed by the specified installed plug-in instance.- Parameters:
ip
- the installed plug-in whose plug-in instance will use the contextmodifiers
- a bitmap of the modifier keys to indicate are currently pressed, or 0- Returns:
- a suitable plug-in context
- Throws:
PluginException
- if an exception occurs while accessing the plug-in
-
createProbeContext
public static PluginContext createProbeContext(AbstractInstalledPlugin ip, Plugin p) throws PluginException
Creates a plug-in context suitable for probing the plug-in currently managed by the specified installed plug-in instance.- Parameters:
ip
- the installed plug-in whose plug-in instance will use the contextp
- the plug-in to be probed- Returns:
- a suitable plug-in context
- Throws:
PluginException
- if an exception occurs while accessing the plug-in
-
createContext
public static PluginContext createContext(Plugin plugin, int modifiers)
Creates a context for a plug-in. The plug-in must be the active plug-in instance for anInstalledPlugin
.- Parameters:
plugin
- the plug-in to look up the installed plug-in formodifiers
- the modifier keys to indicate are currently pressed- Returns:
- a suitable plug-in context
- Throws:
java.lang.IllegalArgumentException
- if the plug-in is not being managed by any installed plug-in- See Also:
BundleInstaller.getInstalledPlugins()
-
createProbeContext
public static PluginContext createProbeContext(Plugin plugin)
Creates a context suitable for probing a plug-in. The plug-in must be the active plug-in instance for anInstalledPlugin
.- Parameters:
plugin
- the plug-in to look up the installed plug-in for- Returns:
- a suitable plug-in context
- Throws:
java.lang.IllegalArgumentException
- if the plug-in is not being managed by any installed plug-in- See Also:
BundleInstaller.getInstalledPlugins()
-
createDummyContext
public static PluginContext createDummyContext()
Returns a dummy context. Dummy contexts are used when a script is run from a code editor. They provide basic functionality so that plug-in developers can test plug-in scripts by running the script directly from the editor.- Returns:
- a dummy plug-in context
-
createDummyContext
public static PluginContext createDummyContext(int modifiers)
Returns a dummy context. Dummy contexts are used when a script is run from a code editor. They provide basic functionality so that plug-in developers can test plug-in scripts by running the script directly from the editor.- Parameters:
modifiers
- a bit mask of the modifier keys that the context will report as being held down at activation- Returns:
- a dummy plug-in context
-
-