public abstract class AbstractPluginTemplate extends AbstractPluginBase
This template handle typical plugin that shows UI if run without parameters or run in
background (without UI) if valid parameter string is passed to AbstractPluginBase.run(String)
.
Following workflow specified in AbstractPluginBase
, this implementation calls
runPlugin()
from executer()
.
apiCall, errorSink, logger, options
Modifier | Constructor and Description |
---|---|
protected |
AbstractPluginTemplate()
This default constructor must be overridden in concrete class.
|
protected |
AbstractPluginTemplate(AbstractPluginOptions options,
String pluginName)
Default constructor.
|
|
AbstractPluginTemplate(String argString,
AbstractPluginOptions options,
String pluginName)
Constructor that allows to provide own parameters.
|
Modifier and Type | Method and Description |
---|---|
protected void |
executer()
Executed if
AbstractPluginBase.run(String) got parsable parameter string. |
protected abstract void |
runPlugin()
Main plugin logic.
|
run, setPluginName, showUi
getOptions, parseArgumentString, publishMacroString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
about
protected AbstractPluginTemplate()
AbstractPluginOptions
class should be
created there and then passed to
AbstractPluginTemplate(AbstractPluginOptions, String)
.protected AbstractPluginTemplate(AbstractPluginOptions options, String pluginName)
Set api call to false and assign provided options to object.
options
- Reference to plugin configuration container.pluginName
- name of the plugin that will be displayed in Macro Recorderpublic AbstractPluginTemplate(String argString, AbstractPluginOptions options, String pluginName) throws QuimpPluginException
Intended to run from API. Set AbstractOptionsParser.apiCall
to true and AbstractOptionsParser.errorSink
to
QuimpException.MessageSinkTypes.CONSOLE
.
AbstractPluginOptions
is initialised from specified string and assigned to this
instance.
argString
- parameters string like that passed in macro. If it is empty string or null
constructor exits before deserialisation.options
- Reference to plugin configuration container.pluginName
- name of the plugin that will be displayed in Macro RecorderQuimpPluginException
- on any error in plugin execution.protected void executer() throws QuimpException
AbstractPluginBase
AbstractPluginBase.run(String)
got parsable parameter string.executer
in class AbstractPluginBase
QuimpException
- on any error. Exception is handled depending on
AbstractOptionsParser.errorSink
set by AbstractPluginBase.run(String)
protected abstract void runPlugin() throws QuimpPluginException
QuimpPluginException
- on any error, handled by AbstractPluginBase.run(String)
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.