com.efiAnalytics.plugin
Interface ApplicationPlugin


public interface ApplicationPlugin

This is the root class for a TunerStudio plugin. Plugins will be identified and instantiated from here.

Author:
Phil Tobin

Field Summary
static int DIALOG_WIDGET
          typical panel to be placed on any settings dialog as defined in the ECU Definition (ini) file.
static int PERSISTENT_DIALOG_PANEL
          Like a typical panel, but persistently listed on the menu independent of ecu configuration.
static double PLUGIN_API_VERSION
          TunerStudio Plugin API Specification
static int TAB_PANEL
          panel to be added as a tab on the main display area
 
Method Summary
 void close()
          called when the visual JComponents is dismissed.
 boolean displayPlugin(java.lang.String controllerSignature)
          This is called each time menu are being reconstructed.
 java.lang.String getAuthor()
          the Author of this plugin
 java.lang.String getDescription()
          Description for this plugin.
 java.lang.String getDisplayName()
          the name for this plugin to be displayed on the menu or tab
 java.lang.String getHelpUrl()
          returns a url to web help for this plugin.
 java.lang.String getIdName()
          return the identifier for this plugin/panel this will be the reference used in the ui structure of the ecu configuration / ini file
 javax.swing.JComponent getPluginPanel()
          Provides access to the main plugin visual component.
 int getPluginType()
          The type of plugin the host application should recognize this as
 double getRequiredPluginSpec()
          the minimum Plugin specification your plugin requires to perform as expected.
 java.lang.String getVersion()
          the version of the plugin implementation.
 void initialize(ControllerAccess controllerAccess)
          This will be called when the plugin is about to be displayed.
 boolean isMenuEnabled()
          called when on display of a menu or when settings change to determine if this plugin Menu or tab should be enabled.
 

Field Detail

DIALOG_WIDGET

static final int DIALOG_WIDGET
typical panel to be placed on any settings dialog as defined in the ECU Definition (ini) file. It will be treated as any other Dialog or panel defined in the ini.

See Also:
Constant Field Values

PERSISTENT_DIALOG_PANEL

static final int PERSISTENT_DIALOG_PANEL
Like a typical panel, but persistently listed on the menu independent of ecu configuration. By default this will be listed on the Tools menu.

See Also:
Constant Field Values

TAB_PANEL

static final int TAB_PANEL
panel to be added as a tab on the main display area

See Also:
Constant Field Values

PLUGIN_API_VERSION

static final double PLUGIN_API_VERSION
TunerStudio Plugin API Specification

See Also:
Constant Field Values
Method Detail

getIdName

java.lang.String getIdName()
return the identifier for this plugin/panel this will be the reference used in the ui structure of the ecu configuration / ini file

Returns:
the identifier for this plugin/panel

getPluginType

int getPluginType()
The type of plugin the host application should recognize this as

Returns:
An int value that must be equal to The values listed in this interface.
See Also:
DIALOG_PANEL, PERSISTENT_PANEL, TAB_PANEL

getDisplayName

java.lang.String getDisplayName()
the name for this plugin to be displayed on the menu or tab

Returns:
the name for this plugin to be displayed on the

getDescription

java.lang.String getDescription()
Description for this plugin.

Returns:
the name for this plugin to be displayed to the user

initialize

void initialize(ControllerAccess controllerAccess)
This will be called when the plugin is about to be displayed. GUI building and subscriptions to OutputChannel or EcuParameters should be made here. Try to avoid heavy work in the constructor for faster interrogation of the plugin.

Parameters:
controllerAccess - An implementation of ControllerAccess with an OuputChannelManager and ControllerParameterManager for access to the Controller.

displayPlugin

boolean displayPlugin(java.lang.String controllerSignature)
This is called each time menu are being reconstructed. This will typically be on project open or any time the working Controller Configuration changes. This will allow you to only display a plugin when the current Controller is supported.

Parameters:
controllerSignature - The signature of the Controller configuration about to become active as the working configuration
Returns:
true if the plugin should be displayed with signature.
false if the Controller is not supported or should not be displayed at this time.

isMenuEnabled

boolean isMenuEnabled()
called when on display of a menu or when settings change to determine if this plugin Menu or tab should be enabled. Typically an ApplicationPlugin would evaluate the current settings or evaluate an expression to determine if the menu should be enabled.

Returns:
true if the menu to access this plugin should be enabled.

getAuthor

java.lang.String getAuthor()
the Author of this plugin

Returns:
The Authors name.

getPluginPanel

javax.swing.JComponent getPluginPanel()
Provides access to the main plugin visual component. Most plugin are expected to to have a visual UI Panel. This method provides access to the UI Component and will be called when the Plugin is about to be displayed. The Jcomponent will be displayed in a dialog.

Returns:
The primary plugin UI swing JComponent. Typically and extension of JPanel.

close

void close()
called when the visual JComponents is dismissed. The Plugin is expected to finish any writes to the Controller. After this is called this plugin will be unsubscribed from ControllerServer and OutputChannelServer. if the plugin is displayed again, initialze will be called again.


getHelpUrl

java.lang.String getHelpUrl()
returns a url to web help for this plugin.

Returns:
a proper http URL of the format: http://www.yourdomain.com/yourPage

getVersion

java.lang.String getVersion()
the version of the plugin implementation.

Returns:
an identifier of the plugin version

getRequiredPluginSpec

double getRequiredPluginSpec()
the minimum Plugin specification your plugin requires to perform as expected. This will be called upon plugin installation and load. TunerStudio will validate that it supports the required specification for your plug in.

Returns:
the required specification versions