|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.jaspira.plugin.AbstractPlugin
public abstract class AbstractPlugin
Abstract superclass for plugins.
| Nested Class Summary | |
|---|---|
class |
AbstractPlugin.StandardPluginEvents
Event module. |
| Field Summary | |
|---|---|
static java.lang.String |
PROPERTY_CONDITION
Conditional expression resource key |
static java.lang.String |
PROPERTY_DESCRIPTION
Description resource key |
static java.lang.String |
PROPERTY_ICON
Icon resource key |
static java.lang.String |
PROPERTY_NAME
Plugin name resource key |
static java.lang.String |
PROPERTY_SEQUENCE
Key sequence to show the plugin |
static java.lang.String |
PROPERTY_TITLE
Title resource key |
static java.lang.String |
PROPERTY_VENDOR
Vendor resource key |
static java.lang.String |
PROPERTY_VERSION
Version resource key |
| Fields inherited from interface org.openbp.jaspira.plugin.Plugin |
|---|
ID_DELIMETER, LEVEL_APPLICATION, LEVEL_FRAME, LEVEL_PAGE, LEVEL_PLUGIN |
| Constructor Summary | |
|---|---|
AbstractPlugin()
Standard constructor. |
|
| Method Summary | |
|---|---|
protected void |
addActionKeySequence(KeySequence sequence,
JaspiraAction action)
Adds a key sequence that triggers the given action. |
void |
addPlugin(Plugin child)
Adds a plugin as child plugin of this plugin. |
void |
addToPeerGroup(java.lang.String peerName,
java.lang.Object group)
Adds the plugin to a peer group given by key and object. |
boolean |
canClose()
Checks, whether this plugin can be closed. |
protected void |
closeCanceled()
This method is called when the closing has been vetoed by a plugin. |
boolean |
containsStackedEvent(java.lang.String eventName)
Checks if the event stack contains a particular event. |
boolean |
fireEvent(JaspiraEvent je)
Fires the given event using the event queue. |
boolean |
fireEvent(java.lang.String eventName)
Creates a new client event using the given event name and fires it. |
boolean |
fireEvent(java.lang.String eventName,
java.lang.Object data)
Creates a new client event using the given event name and event object and fires it. |
JaspiraAction |
getAction(java.lang.String actionName)
This convenience method retrieves an action from the action manager. |
java.util.List |
getChildPlugins()
Returns a list of all children of this plugin. |
java.lang.String |
getClassName()
Returns the class name of the plugin. |
java.lang.String |
getCondition()
Gets the conditional expression that determines if the plugin should be active. |
java.util.List |
getDescendantPlugins(java.util.List result)
Returns a list of all children and further descendants of this plugin. |
java.lang.String |
getDescription()
Gets the description. |
java.util.List |
getEventActionNames()
Gets a list of the action names of the event actions of this plugin. |
protected java.util.List |
getEventModules()
Returns a list of the event modules of this plugin. |
protected java.util.Collection |
getExternalActions()
Returns a collection of the external actions of this plugin. |
protected java.lang.Class[] |
getExternalEventModuleClasses()
Returns the list of external event module classes. |
protected java.lang.Class[] |
getExternalOptionModuleClasses()
Returns a list of external option module classes of this plugin. |
MultiIcon |
getIcon()
Gets the icon. |
MultiIcon |
getIcon(java.lang.String iconName)
Convenience method for retrieving an icon from the resourcepackage. |
int |
getLevel()
Returns the level of this plugin in the plugin tree. |
java.lang.String |
getName()
Returns the name of the plugin. |
protected java.util.List |
getOptionModules()
Returns a list of all option modules of this plugin. |
Plugin |
getParentPlugin()
Returns the parent plugin of this plugin. |
java.lang.Object |
getPeerGroup(java.lang.String peerName)
Gets the peer group for the given group name. |
java.util.Set |
getPeerGroupNames()
Returns the names of all peergroups that this plugin has been added to. |
java.util.Set |
getPeerGroups()
Returns the peer groups this plugin has been added to. |
ResourceCollection |
getPluginResourceCollection()
Gets the plugin resource. |
PluginState |
getPluginState()
Returns the state of this plugin. |
abstract java.lang.String |
getResourceCollectionContainerName()
Gets the name of the resource component the default resource of the plugin belongs to. |
java.util.List |
getSubClients()
Gets the Dnd sub clients of this plugin. |
java.lang.String |
getSubTitle()
Returns the sub title of this plugin. |
java.lang.String |
getTitle()
Gets the title. |
java.lang.String |
getUniqueId()
Returns the unique id of this plugin. |
java.lang.String |
getVendor()
Gets the plugin vendor. |
java.lang.String |
getVersion()
Gets the plugin version. |
boolean |
handleEvent(JaspiraEvent je)
Tries to handles the event for this plugin without passing it on. |
protected boolean |
handleKeySequence(KeySequence ks)
Invokes the action associated with the given key sequence if applicable. |
boolean |
inheritEvent(JaspiraEvent je)
Receives an event incoming from a parent. |
protected void |
initializeFromPluginProfile(PluginProfile profile)
Initializes some properties from the given plugin profile. |
void |
initializePlugin()
Initializes the plugin. |
protected void |
initializeResources()
Loads the plugin resources. |
void |
installFirstPlugin()
This template method is called before the first plugin instance of this kind is installed. |
void |
installPlugin()
Installs the plugin and all its modules. |
protected void |
installPluginContent()
Installs the contents of the plugin. |
boolean |
matchesPeerGroup(java.lang.String peerName,
java.lang.Object group,
boolean strict)
Check if the plugin is a member of the given peer group. |
boolean |
matchesPeerGroups(Plugin plugin,
boolean strict)
Matches all peer groups of one plugin against another. |
protected boolean |
passDown(JaspiraEvent je)
Passes an event down to the child plugins. |
protected void |
pluginInstalled()
This template method is called after the plugin has been installed. |
protected void |
pluginUninstalled()
This template method is called before the plugin is uninstalled. |
protected void |
preClose()
This method is called when actual closing is performed. |
boolean |
receiveEvent(JaspiraEvent je)
Handles an incoming event that is received from a child plugin. |
void |
removeFromPeerGroup(java.lang.String peerName)
Removes the plugin from a peer group. |
void |
removePlugin(Plugin child)
Removes a child plugin from this plugin. |
void |
removeStackedEvent(java.lang.String eventName)
Removes any events with the given name from the event stack. |
boolean |
requestClose()
Request the plugin to be closed. |
void |
setDescription(java.lang.String description)
Sets the description. |
void |
setIcon(MultiIcon icon)
Sets the icon. |
void |
setName(java.lang.String name)
Sets the plugin name (can be null). |
void |
setParentPlugin(Plugin newParent)
Sets the parent plugin of this plugin. |
void |
setPluginState(PluginState state)
Rebuilds the state of the plugin using the given state object. |
void |
setResourceCollection(ResourceCollection resourceCollection)
Sets the plugin resource. |
void |
setTitle(java.lang.String title)
Sets the title. |
void |
stackEvent(JaspiraEvent je)
Adds a stackable event to the event stack. |
java.lang.String |
toString()
Returns a string representation of this plugin |
void |
uninstallLastPlugin()
This is called after uninstall for the last instance has been uninstalled. |
void |
uninstallPlugin()
Uninstalls the plugin and all of its modules. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROPERTY_DESCRIPTION
public static final java.lang.String PROPERTY_NAME
public static final java.lang.String PROPERTY_TITLE
public static final java.lang.String PROPERTY_ICON
public static final java.lang.String PROPERTY_VERSION
public static final java.lang.String PROPERTY_VENDOR
public static final java.lang.String PROPERTY_SEQUENCE
public static final java.lang.String PROPERTY_CONDITION
| Constructor Detail |
|---|
public AbstractPlugin()
| Method Detail |
|---|
public void initializePlugin()
initializePlugin in interface Pluginpublic void installPlugin()
installPlugin in interface Pluginprotected void installPluginContent()
public void uninstallPlugin()
PluginMgr.removeInstance(Plugin) instead.
uninstallPlugin in interface Pluginpublic void installFirstPlugin()
initializePlugin() method has been called.
installFirstPlugin in interface Pluginpublic void uninstallLastPlugin()
uninstallLastPlugin() method has been called.
uninstallLastPlugin in interface Pluginprotected void initializeResources()
protected void initializeFromPluginProfile(PluginProfile profile)
profile - Profile
protected void addActionKeySequence(KeySequence sequence,
JaspiraAction action)
sequence - Sequence to addaction - Action to execute if the sequence is recognizedpublic java.lang.String toString()
toString in class java.lang.Objectprotected void pluginInstalled()
protected void pluginUninstalled()
protected java.lang.Class[] getExternalOptionModuleClasses()
OptionModule .protected java.lang.Class[] getExternalEventModuleClasses()
ExternalEventModuleprotected java.util.Collection getExternalActions()
JaspiraAction objects or nullpublic java.util.List getSubClients()
InteractionClient or null otherwisepublic boolean fireEvent(JaspiraEvent je)
fireEvent in interface Pluginje - Event to fire
public boolean fireEvent(java.lang.String eventName)
fireEvent in interface PlugineventName - Name of the event
public boolean fireEvent(java.lang.String eventName,
java.lang.Object data)
fireEvent in interface PlugineventName - Name of the eventdata - Event object
protected boolean passDown(JaspiraEvent je)
je - Event to pass
public boolean handleEvent(JaspiraEvent je)
handleEvent in interface Pluginje - The event to handle
public boolean receiveEvent(JaspiraEvent je)
receiveEvent in interface Pluginje - The event to handle
public boolean inheritEvent(JaspiraEvent je)
inheritEvent in interface Pluginje - The event to handle
public void stackEvent(JaspiraEvent je)
stackEvent in interface Pluginje - The event to stackpublic boolean containsStackedEvent(java.lang.String eventName)
containsStackedEvent in interface PlugineventName - Event to look for
public void removeStackedEvent(java.lang.String eventName)
eventName - Event to removepublic java.util.List getChildPlugins()
getChildPlugins in interface Pluginpublic java.util.List getDescendantPlugins(java.util.List result)
getDescendantPlugins in interface Pluginresult - The children of this plugin will be added to this list, if given
public Plugin getParentPlugin()
ApplicationBase must have a parent.
getParentPlugin in interface Pluginpublic void setParentPlugin(Plugin newParent)
ApplicationBase must have a parent.
setParentPlugin in interface PluginnewParent - New parent of this plugin or null in case of ApplicationBasepublic void addPlugin(Plugin child)
addPlugin in interface Pluginchild - Child plugin to addpublic void removePlugin(Plugin child)
removePlugin in interface Pluginchild - Child plugin to removepublic int getLevel()
getLevel in interface PluginPlugin.LEVEL_APPLICATION being the lowest.
Defaults to Plugin.LEVEL_PLUGIN.protected boolean handleKeySequence(KeySequence ks)
ks - Key sequence to handle
public abstract java.lang.String getResourceCollectionContainerName()
public ResourceCollection getPluginResourceCollection()
getPluginResourceCollection in interface Pluginpublic void setResourceCollection(ResourceCollection resourceCollection)
public java.lang.String getTitle()
getTitle in interface Pluginpublic void setTitle(java.lang.String title)
public java.lang.String getSubTitle()
getSubTitle in interface Pluginpublic java.lang.String getDescription()
getDescription in interface Pluginpublic void setDescription(java.lang.String description)
public MultiIcon getIcon()
getIcon in interface Pluginpublic void setIcon(MultiIcon icon)
public java.lang.String getVendor()
getVendor in interface Pluginpublic java.lang.String getVersion()
getVersion in interface Pluginpublic java.lang.String getCondition()
getCondition in interface Pluginpublic PluginState getPluginState()
getPluginState in interface Pluginpublic void setPluginState(PluginState state)
setPluginState in interface Pluginpublic final java.lang.String getName()
getName in interface PlugingetClassName())
unless not otherwise set or specified in the resource file.public void setName(java.lang.String name)
public java.lang.String getClassName()
getClassName in interface Pluginpublic final java.lang.String getUniqueId()
getUniqueId in interface Pluginprotected final java.util.List getEventModules()
EventModule objects or null if the plugin does not define event modules as inner classesprotected final java.util.List getOptionModules()
public java.util.List getEventActionNames()
getEventActionNames in interface Pluginpublic JaspiraAction getAction(java.lang.String actionName)
getAction in interface PluginactionName - Action name
public MultiIcon getIcon(java.lang.String iconName)
iconName - Icon resource name
public java.util.Set getPeerGroups()
getPeerGroups in interface Pluginpublic java.util.Set getPeerGroupNames()
getPeerGroupNames in interface Plugin
public void addToPeerGroup(java.lang.String peerName,
java.lang.Object group)
addToPeerGroup in interface PluginpeerName - Peer group namegroup - Peer group objectpublic java.lang.Object getPeerGroup(java.lang.String peerName)
getPeerGroup in interface PluginpeerName - Name of the peer group
public void removeFromPeerGroup(java.lang.String peerName)
removeFromPeerGroup in interface PluginpeerName - Peer group name
public boolean matchesPeerGroup(java.lang.String peerName,
java.lang.Object group,
boolean strict)
matchesPeerGroup in interface PluginpeerName - Name of the peer group to checkgroup - Peer group to checkstrict - true The peergroups must be exactly met.
public boolean matchesPeerGroups(Plugin plugin,
boolean strict)
matchesPeerGroups in interface Pluginplugin - Plugin to match agains this pluginstrict - true All peer groups must match.public boolean canClose()
preClose() or closeCanceled().
canClose in interface Pluginpublic boolean requestClose()
preClose() and then remove the plugin instance.
So if a plugin is being closed, all its children will be closed, too.
requestClose in interface Pluginprotected void preClose()
protected void closeCanceled()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||