public class PluginProxyManager extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ACTIVATED_STATE
The plugin state 'activated'.
|
static int |
LOADED_STATE
The plugin state 'loaded'.
|
static Localizer |
mLocalizer
The localizer for this class.
|
static String |
PLUGIN_DIRECTORY
The name of the directory where the plugins are located in TV-Browser 2.01
and before
|
static int |
SHUT_DOWN_STATE
The plugin state 'shut down'.
|
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 JPopupMenu |
createPluginContextMenu(Program program)
Creates a context menu for the given program containing all plugins.
|
static 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 |
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(String pluginId)
Gets the activated plugin with the given ID.
|
PluginProxy[] |
getActivatedPlugins()
Gets all activated plugins.
|
PluginProxy[] |
getAllPlugins()
Gets all plugins.
|
String[] |
getDeactivatedPluginIds()
Gets the IDs of all deactivated plugins.
|
static PluginProxyManager |
getInstance()
Gets the singleton.
|
static String |
getLocalizedStateName(int state)
Gets the localized name of a state.
|
PluginProxy |
getPluginForId(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(Frame parent)
Sets the parent frame to all plugins.
|
void |
setPluginOrder(String[] pluginOrderArr)
Sets the plugin order.
|
void |
shutdownAllPlugins(boolean log)
Deactivates and shuts down all plugins.
|
public static final Localizer mLocalizer
public static final String PLUGIN_DIRECTORY
public static final int SHUT_DOWN_STATE
An shut down plugin has been shut down and can't be used any more.
public static final int LOADED_STATE
A loaded plugin has an existing PluginProxy instance, but is not activated.
public static final int ACTIVATED_STATE
An activated plugin has loaded its settings and is ready to be used.
public static PluginProxyManager getInstance()
public void registerPlugin(AbstractPluginProxy plugin)
public void init() throws TvBrowserException
TvBrowserException
- If initialization failed.public void setParentFrame(Frame parent)
parent
- The parent frame to set.public void setPluginOrder(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 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 String getLocalizedStateName(int state)
state
- The state to get the localized name for.public PluginProxy[] getAllPlugins()
public PluginProxy[] getActivatedPlugins()
public String[] getDeactivatedPluginIds()
public PluginProxy getPluginForId(String pluginId)
pluginId
- The ID of the wanted plugin.null
if no such
plugin exists.public PluginProxy getActivatedPluginForId(String pluginId)
pluginId
- The ID of the wanted plugin.null
if no such
plugin exists or if the plugin is not activated.public static JPopupMenu createPluginContextMenu(Program program)
program
- The program to create the context menu forpublic static 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)
TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)