public class PluginManagerImpl extends Object implements PluginManager
SEARCHER_TYPE_BOOLEAN, SEARCHER_TYPE_EXACTLY, SEARCHER_TYPE_KEYWORD, SEARCHER_TYPE_REGULAR_EXPRESSION
Modifier and Type | Method and Description |
---|---|
JPopupMenu |
createPluginContextMenu(Program program,
ContextMenuIf caller)
Creates a context menu for the given program containing all plugins.
|
ProgramSearcher |
createProgramSearcher(int type,
String searchTerm,
boolean caseSensitive)
Creates a ProgramSearcher.
|
PluginAccess |
getActivatedPluginForId(String pluginId)
Gets the activated plugin with the given ID.
|
PluginAccess[] |
getActivatedPlugins()
Returns all activated Plugins.
|
ProgramFilter[] |
getAvailableFilters()
Deprecated.
since 2.2.5 Use
FilterManager.getAvailableFilters() instead. |
Iterator |
getChannelDayProgram(Date date,
Channel channel)
Gets an iterator through all programs of the specified channel at the
specified date.
|
TvDataService |
getDataService(String dataServiceClassName)
Deprecated.
|
TvDataServiceProxy |
getDataServiceProxy(String id) |
PluginAccess |
getDefaultContextMenuPlugin()
Gets the plugin that is used as default in the context menu.
|
Program |
getExampleProgram()
Returns an example program.
|
FilterManager |
getFilterManager()
Returns the filter manager of TV-Browser (2.2.x version).
|
ImageIcon |
getIconFromTheme(Plugin plugin,
String category,
String iconName,
int size)
Returns an Icon from the Icon-Theme-System
If your Plugin has Icons that are not available as Icons within an Theme, you can add
your Icons into your Jar-File.
|
ImageIcon |
getIconFromTheme(Plugin plugin,
ThemeIcon icon)
Returns an Icon from the Icon-Theme-System
If your Plugin has Icons that are not available as Icons within an Theme, you can add
your Icons into your Jar-File.
|
Plugin[] |
getInstalledPlugins()
Deprecated.
Since 1.1. Use
getActivatedPlugins() instead. |
static PluginManager |
getInstance() |
String |
getJavaPluginId(Plugin javaPlugin)
Gets the ID of the given Java plugin.
|
Program[] |
getMarkedPrograms()
Return all marked programs.
|
Program |
getProgram(Date date,
String progID)
Gets a program.
|
Channel[] |
getSubscribedChannels()
Gets all channels the user has subscribed.
|
TvBrowserSettings |
getTvBrowserSettings()
Returns some settings a plugin may need.
|
void |
handleProgramDoubleClick(Program program)
Handles a double click on a program.
|
void |
handleProgramDoubleClick(Program program,
ContextMenuIf caller)
Handles a double click on a program.
|
void |
handleProgramMiddleClick(Program program)
Handles a middle click on a program.
|
void |
handleProgramMiddleClick(Program program,
ContextMenuIf caller)
Handles a middle click on a program.
|
protected void |
handleTvBrowserStartFinished() |
Program[] |
search(String regex,
boolean inTitle,
boolean inText,
boolean caseSensitive,
Channel[] channels,
Date startDate,
int nrDays)
Deprecated.
Use
createProgramSearcher(int, String, boolean)
instead. |
Program[] |
search(String regex,
boolean caseSensitive,
ProgramFieldType[] fieldArr,
Date startDate,
int nrDays,
Channel[] channels,
boolean sortByStartTime)
Deprecated.
Since 1.1. Use
createProgramSearcher(int, String, boolean)
instead. |
void |
showSettings(Plugin plugin)
Show the Settings-Dialog for a Plugin
|
void |
showSettings(String settingsItem)
Show the Settings-Dialog with a Specific SettingsItem
|
public static PluginManager getInstance()
public Program getProgram(Date date, String progID)
getProgram
in interface PluginManager
date
- The date when the program is shown.progID
- The ID of the program.null
if there is no such program.public Channel[] getSubscribedChannels()
getSubscribedChannels
in interface PluginManager
public Iterator getChannelDayProgram(Date date, Channel channel)
getChannelDayProgram
in interface PluginManager
date
- The date of the programs.channel
- The channel of the programs.null
if the requested data is not available.public Program[] search(String regex, boolean inTitle, boolean inText, boolean caseSensitive, Channel[] channels, Date startDate, int nrDays) throws TvBrowserException
createProgramSearcher(int, String, boolean)
instead.search
in interface PluginManager
regex
- The regular expression programs must match to.inTitle
- Should be searched in the title?inText
- Should be searched in the desription?caseSensitive
- Should the search be case sensitive?channels
- The channels to search in.startDate
- The date to start the search.nrDays
- The number of days to include after the start date. If
negative the days before the start date are used.TvBrowserException
- If there is a syntax error in the regular expression.public Program[] search(String regex, boolean caseSensitive, ProgramFieldType[] fieldArr, Date startDate, int nrDays, Channel[] channels, boolean sortByStartTime) throws TvBrowserException
createProgramSearcher(int, String, boolean)
instead.search
in interface PluginManager
regex
- The regular expression programs must match to.caseSensitive
- Should the search be case sensitive?fieldArr
- The fields to search instartDate
- The date to start the search.nrDays
- The number of days to include after the start date. If
negative the days before the start date are used.channels
- The channels to search in.sortByStartTime
- Should the results be sorted by the start time?
If not, the results will be grouped by date and channel and the
search will be faster.TvBrowserException
TvBrowserException
- If there is a syntax error in the regular expression.public ProgramSearcher createProgramSearcher(int type, String searchTerm, boolean caseSensitive) throws TvBrowserException
createProgramSearcher
in interface PluginManager
type
- The searcher type to create. Must be one of
PluginManager.SEARCHER_TYPE_EXACTLY
, PluginManager.SEARCHER_TYPE_KEYWORD
,
PluginManager.SEARCHER_TYPE_REGULAR_EXPRESSION
or
PluginManager.SEARCHER_TYPE_BOOLEAN
.searchTerm
- The search term the searcher should look for.caseSensitive
- Specifies whether the searcher should be case sensitive.TvBrowserException
- If creating the program searcher failed.public PluginAccess[] getActivatedPlugins()
getActivatedPlugins
in interface PluginManager
public String getJavaPluginId(Plugin javaPlugin)
getJavaPluginId
in interface PluginManager
javaPlugin
- The Java plugin to get the ID for.public PluginAccess getActivatedPluginForId(String pluginId)
getActivatedPluginForId
in interface PluginManager
pluginId
- The ID of the wanted plugin.null
if no such plugin
exists or if the plugin is not activated.public Plugin[] getInstalledPlugins()
getActivatedPlugins()
instead.
This method always returns an empty array! Use
getActivatedPlugins()
instead!
getInstalledPlugins
in interface PluginManager
public TvDataService getDataService(String dataServiceClassName)
getDataService
in interface PluginManager
dataServiceClassName
- the class name of the wanted TvDataService.null
if there is no such
TvDataService.public TvDataServiceProxy getDataServiceProxy(String id)
getDataServiceProxy
in interface PluginManager
public JPopupMenu createPluginContextMenu(Program program, ContextMenuIf caller)
createPluginContextMenu
in interface PluginManager
program
- The program to create the context menu forcaller
- The calling plugin.public ProgramFilter[] getAvailableFilters()
FilterManager.getAvailableFilters()
instead.getAvailableFilters
in interface PluginManager
public Program getExampleProgram()
getExampleProgram
in interface PluginManager
public void handleProgramDoubleClick(Program program)
Executes the default context menu plugin. Plugins should use handleProgramDoubleClick(Program program, Plugin caller). It prevetns the Plugin to be activated a second time.
handleProgramDoubleClick
in interface PluginManager
program
- The program to pass to the default context menu plugin.public void handleProgramDoubleClick(Program program, ContextMenuIf caller)
Executes the default context menu plugin.
handleProgramDoubleClick
in interface PluginManager
program
- The program to pass to the default context menu plugin.caller
- ContextMenuIf that calls this. Prevents the ContextMenuIf to be activated twicepublic void handleProgramMiddleClick(Program program)
Executes the middle click context menu plugin. Plugins should use handleProgramMiddleClick(Program program, Plugin caller). It prevents the Plugin to be activated a second time.
handleProgramMiddleClick
in interface PluginManager
program
- The program to pass to the middle click context menu plugin.public void handleProgramMiddleClick(Program program, ContextMenuIf caller)
Executes the middle click context menu plugin.
handleProgramMiddleClick
in interface PluginManager
program
- The program to pass to the middle click context menu plugin.caller
- ContextMenuIf that calls this. Prevents the ContextMenuIf to be activated twice.public PluginAccess getDefaultContextMenuPlugin()
public TvBrowserSettings getTvBrowserSettings()
getTvBrowserSettings
in interface PluginManager
public ImageIcon getIconFromTheme(Plugin plugin, String category, String iconName, int size)
getIconFromTheme
in interface PluginManager
plugin
- Plugin that wants to load an Iconcategory
- Category of the Icon (Action, etc...)iconName
- Icon-Name without File-Extensionsize
- Size of the Iconpublic ImageIcon getIconFromTheme(Plugin plugin, ThemeIcon icon)
getIconFromTheme
in interface PluginManager
plugin
- Plugin that wants to load an Iconicon
- ThemeIcon that represents the Iconsize
- Size of the Iconpublic void showSettings(Plugin plugin)
showSettings
in interface PluginManager
plugin
- Use this Pluginpublic void showSettings(String settingsItem)
showSettings
in interface PluginManager
settingsItem
- SettingsItem to show (e.g. SettingsItem.CHANNELS)public Program[] getMarkedPrograms()
getMarkedPrograms
in interface PluginManager
public FilterManager getFilterManager()
getFilterManager
in interface PluginManager
null
if TV-Browser isn't fully loaded.protected void handleTvBrowserStartFinished()
TV-Browser 2.2.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)