public class PluginProxyManager
extends java.lang.Object
Note: This class is not called "PluginManager" as in older versions, to make
a difference to the class PluginManager
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PLUGIN_DIRECTORY
The name of the directory where the plugins are located in TV-Browser 2.01
and before
|
Modifier and Type | Method and Description |
---|---|
void |
activatePlugin(PluginProxy plugin)
Activates a plugin.
|
void |
activatePlugin(PluginProxy plugin,
boolean setParentFrame)
Activates a plugin.
|
void |
addPluginStateListener(PluginStateListener listener)
Registers a PluginStateListener.
|
static javax.swing.JPopupMenu |
createPluginContextMenu(Program program)
Creates a context menu for the given program containing all plugins.
|
static javax.swing.JPopupMenu |
createPluginContextMenu(Program program,
ContextMenuIf menuIf)
Creates a context menu for the given program containing all plugins.
|
void |
deactivatePlugin(PluginProxy plugin)
Deactivates a plugin.
|
void |
firePluginBlockListRenewed()
Reacts on a change of the blocked plugins setting
and deactivates all blocked plugins.
|
void |
fireTvBrowserSettingsChanged() |
void |
fireTvBrowserStartFinished()
Calls for every subscribed plugin the handleTvBrowserStartComplete() method,
so the plugin knows when the TV-Browser start is finished.
|
void |
fireTvBrowserStartFinished(PluginProxy plugin) |
PluginProxy |
getActivatedPluginForId(java.lang.String pluginId)
Gets the activated plugin with the given ID.
|
PluginProxy[] |
getActivatedPlugins()
Gets all activated plugins.
|
PluginProxy[] |
getAllPlugins()
Gets all plugins.
|
java.lang.String[] |
getDeactivatedPluginIds()
Gets the IDs of all deactivated plugins.
|
static PluginProxyManager |
getInstance()
Gets the singleton.
|
static java.lang.String |
getLocalizedStateName(int state)
Gets the localized name of a state.
|
PluginProxy |
getPluginForId(java.lang.String pluginId)
Gets the plugin with the given ID.
|
void |
init()
This method must be called on start-up.
|
void |
registerPlugin(AbstractPluginProxy plugin) |
void |
removePlugin(PluginProxy plugin)
Deactivates a plugin and removes it from the PluginList
|
void |
removePluginStateListener(PluginStateListener listener)
Deregisters a PluginStateListener.
|
boolean |
saveSettings(PluginProxy plugin)
Saves the settings for the given PluginProxy.
|
void |
setParentFrame(java.awt.Frame parent)
Sets the parent frame to all plugins.
|
void |
setPluginOrder(java.lang.String[] pluginOrderArr)
Sets the plugin order.
|
void |
shutdownAllPlugins(boolean log)
Deactivates and shuts down all plugins.
|
public static final java.lang.String PLUGIN_DIRECTORY
public static PluginProxyManager getInstance()
public void registerPlugin(AbstractPluginProxy plugin)
public void init() throws TvBrowserException
TvBrowserException
- If initialization failed.public void setParentFrame(java.awt.Frame parent)
parent
- The parent frame to set.public void setPluginOrder(java.lang.String[] pluginOrderArr)
The order will not be saved to the settings. This must be done by the caller.
pluginOrderArr
- The IDs of the plugins in the wanted order. All
missing plugins will be appended at the end.public void activatePlugin(PluginProxy plugin) throws TvBrowserException
plugin
- The plugin to activateTvBrowserException
- If activating failedpublic void activatePlugin(PluginProxy plugin, boolean setParentFrame) throws TvBrowserException
plugin
- The plugin to activateTvBrowserException
- If activating failedpublic void firePluginBlockListRenewed()
public void deactivatePlugin(PluginProxy plugin) throws TvBrowserException
plugin
- The plugin to deactivateTvBrowserException
- If deactivating failedpublic void removePlugin(PluginProxy plugin) throws TvBrowserException
plugin
- The plugin to deactivateTvBrowserException
- If deactivating failedpublic boolean saveSettings(PluginProxy plugin)
plugin
- The plugin proxy to save the settings for.public void shutdownAllPlugins(boolean log)
log
- If the logging is activated.public static java.lang.String getLocalizedStateName(int state)
state
- The state to get the localized name for.public PluginProxy[] getAllPlugins()
public PluginProxy[] getActivatedPlugins()
public java.lang.String[] getDeactivatedPluginIds()
public PluginProxy getPluginForId(java.lang.String pluginId)
pluginId
- The ID of the wanted plugin.null
if no such
plugin exists.public PluginProxy getActivatedPluginForId(java.lang.String pluginId)
pluginId
- The ID of the wanted plugin.null
if no such
plugin exists or if the plugin is not activated.public static javax.swing.JPopupMenu createPluginContextMenu(Program program)
program
- The program to create the context menu forpublic static javax.swing.JPopupMenu createPluginContextMenu(Program program, ContextMenuIf menuIf)
program
- The program to create the context menu formenuIf
- The ContextMenuIf that wants to create the ContextMenupublic void addPluginStateListener(PluginStateListener listener)
listener
- The PluginStateListener to registerpublic void removePluginStateListener(PluginStateListener listener)
listener
- The PluginStateListener to deregisterpublic void fireTvBrowserStartFinished()
public void fireTvBrowserStartFinished(PluginProxy plugin) throws java.lang.Throwable
java.lang.Throwable
public void fireTvBrowserSettingsChanged()
TV-Browser 3.4.1.0, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)