TV-Browser 3.3.3 API

devplugin
Interface PluginManager

All Known Implementing Classes:
PluginManagerImpl

public interface PluginManager

The PluginManager provides some useful methods for a plugin. More methods may follow in future versions.

Author:
Martin Oberhauser

Field Summary
static int SEARCHER_TYPE_BOOLEAN
          Specifies, that the search term is a boolean expression.
static int SEARCHER_TYPE_EXACTLY
          Specifies, that the search term has to match exactly.
static int SEARCHER_TYPE_KEYWORD
          Specifies, that the search term is a keyword (= substring).
static int SEARCHER_TYPE_REGULAR_EXPRESSION
          Specifies, that the search term is a regular expression.
 
Method Summary
 javax.swing.JPopupMenu createPluginContextMenu(Program program, ContextMenuIf caller)
          Creates a context menu for the given program containing all plugins.
 ProgramSearcher createProgramSearcher(int type, java.lang.String searchTerm, boolean caseSensitive)
          Creates a ProgramSearcher.
 javax.swing.JPopupMenu createRemovedProgramContextMenu(Program program)
          Creates a context menu for the given program.
 void deleteFileOnNextStart(java.lang.String path)
          adds a file name to the list of files to be deleted on next TV-Browser start
 PluginAccess getActivatedPluginForId(java.lang.String pluginId)
          Gets the activated plugin with the given ID.
 PluginAccess[] getActivatedPlugins()
          Returns all activated Plugins.
 ProgramRatingIf[] getAllProgramRatingIfs()
          Gets all ProgramRatingIfs of all plugins.
 AbstractPluginProgramFormating[] getAvailableGlobalPuginProgramFormatings()
          Gets the available global program configurations.
 java.util.Iterator<Program> getChannelDayProgram(Date date, Channel channel)
          Gets an iterator through all programs of the specified channel at the specified date.
 Date getCurrentDate()
          Get the date currently shown in the program table.
 TvDataServiceProxy getDataServiceProxy(java.lang.String id)
           
 Program getExampleProgram()
          Returns an example program.
 FilterManager getFilterManager()
          Returns the filter manager of TV-Browser.
 javax.swing.ImageIcon getIconFromTheme(Plugin plugin, java.lang.String category, java.lang.String icon, 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.
 javax.swing.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.
 java.lang.String getJavaPluginId(Plugin javaPlugin)
          Gets the ID of the given Java plugin.
 Program[] getMarkedPrograms()
          Return all marked programs.
 Program getProgram(Date date, java.lang.String progID)
          Gets a program.
 Program getProgram(java.lang.String uniqueID)
          Gets a program.
 Program[] getPrograms(Date date, java.lang.String progID)
          Gets programs.
 Program[] getPrograms(java.lang.String uniqueID)
          Gets programs.
 ProgramReceiveIf getReceiceIfForId(java.lang.String id)
          Return the ReceiveIfFor given id or null if there is no ReceiveIf for the given id.
 ProgramReceiveIf[] getReceiveIfs()
          Return all Plugins/Functions that are able to receive programs.
 ProgramReceiveIf[] getReceiveIfs(ProgramReceiveIf caller, ProgramReceiveTarget callerTarget)
          Return all Plugins/Functions that are able to receive programs.
 Channel[] getSubscribedChannels()
          Gets all channels the user has subscribed.
 TvBrowserSettings getTvBrowserSettings()
          Returns some settings a plugin may need.
 Version getTVBrowserVersion()
           
 void goToDate(Date date)
          Let TVB change the date to the given date.
 void handleProgramDoubleClick(Program program)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 void handleProgramDoubleClick(Program program, ContextMenuIf caller)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 void handleProgramMiddleClick(Program program)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 void handleProgramMiddleClick(Program program, ContextMenuIf caller)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 void handleProgramMiddleDoubleClick(Program program)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 void handleProgramMiddleDoubleClick(Program program, ContextMenuIf caller)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 void handleProgramSingleClick(Program program)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 void handleProgramSingleClick(Program program, ContextMenuIf caller)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 void handleProgramSingleCtrlClick(Program program, ContextMenuIf caller)
          Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.
 boolean isDataAvailable(Date date)
          check if some TV data is available on the given date
 boolean isTvBrowserStartFinished()
          Gets if TV-Browser start was finished.
 void scrollToChannel(Channel channel)
          Let TVB scroll to the given channel.
 void scrollToProgram(Program program)
          Let TVB scroll to the given program.
 void scrollToTime(int time)
          Let TVB scroll to the given time.
 void scrollToTime(int time, boolean highlight)
          Let TV-Browser scroll to the given time.
 void selectProgram(Program program)
          Selects the given program in the program table.
 boolean showBalloonTip(java.lang.String caption, java.lang.String message, java.awt.TrayIcon.MessageType messageType)
          Shows a balloon tip on the TV-Browser tray icon.
 void showSettings(Plugin plugin)
          Show the Settings-Dialog for a Plugin
 void showSettings(java.lang.String settingsItem)
          Show the Settings-Dialog with a Specific SettingsItem
 

Field Detail

SEARCHER_TYPE_EXACTLY

static final int SEARCHER_TYPE_EXACTLY
Specifies, that the search term has to match exactly.

See Also:
Constant Field Values

SEARCHER_TYPE_KEYWORD

static final int SEARCHER_TYPE_KEYWORD
Specifies, that the search term is a keyword (= substring).

See Also:
Constant Field Values

SEARCHER_TYPE_REGULAR_EXPRESSION

static final int SEARCHER_TYPE_REGULAR_EXPRESSION
Specifies, that the search term is a regular expression.

See Also:
Constant Field Values

SEARCHER_TYPE_BOOLEAN

static final int SEARCHER_TYPE_BOOLEAN
Specifies, that the search term is a boolean expression.

See Also:
Constant Field Values
Method Detail

getProgram

Program getProgram(Date date,
                   java.lang.String progID)
Gets a program.

Parameters:
date - The date when the program is shown.
progID - The ID of the program.
Returns:
The program or null if there is no such program.

getPrograms

Program[] getPrograms(Date date,
                      java.lang.String progID)
Gets programs. (Well this is stupid but if programs start at the same time on the same channel on the same date they have the same id.)

Parameters:
date - The date when the programs are shown.
progID - The ID of the programs.
Returns:
The programs or null if there are no such programs.
Since:
3.3.3

getProgram

Program getProgram(java.lang.String uniqueID)
Gets a program.

Parameters:
uniqueID - The unique ID (Program.getUniqueID()) of this program.
Returns:
The program or null if there is no such program.

getPrograms

Program[] getPrograms(java.lang.String uniqueID)
Gets programs. (Well this is stupid but if programs start at the same time on the same channel on the same date they have the same UniqueID.)

Parameters:
uniqueID - The unique ID (Program.getUniqueID()) of the programs.
Returns:
The programs or null if there are no such programs.
Since:
3.3.3

getSubscribedChannels

Channel[] getSubscribedChannels()
Gets all channels the user has subscribed.

Returns:
all channels the user has subscribed.

getChannelDayProgram

java.util.Iterator<Program> getChannelDayProgram(Date date,
                                                 Channel channel)
Gets an iterator through all programs of the specified channel at the specified date.

Parameters:
date - The date of the programs.
channel - The channel of the programs.
Returns:
an Iterator for all programs of one day and channel or null if the requested data is not available.

createProgramSearcher

ProgramSearcher createProgramSearcher(int type,
                                      java.lang.String searchTerm,
                                      boolean caseSensitive)
                                      throws TvBrowserException
Creates a ProgramSearcher.

Parameters:
type - The searcher type to create. Must be one of SEARCHER_TYPE_EXACTLY, SEARCHER_TYPE_KEYWORD, SEARCHER_TYPE_REGULAR_EXPRESSION or SEARCHER_TYPE_BOOLEAN.
searchTerm - The search term the searcher should look for.
caseSensitive - Specifies whether the searcher should be case sensitive.
Returns:
A program searcher.
Throws:
TvBrowserException - If creating the program searcher failed.

getActivatedPlugins

PluginAccess[] getActivatedPlugins()
Returns all activated Plugins.

Returns:
all activated Plugins.
Since:
1.1

getJavaPluginId

java.lang.String getJavaPluginId(Plugin javaPlugin)
Gets the ID of the given Java plugin.

Parameters:
javaPlugin - The Java plugin to get the ID for.
Returns:
The ID of the given Java plugin.

getActivatedPluginForId

PluginAccess getActivatedPluginForId(java.lang.String pluginId)
Gets the activated plugin with the given ID.

Parameters:
pluginId - The ID of the wanted plugin.
Returns:
The plugin with the given ID or null if no such plugin exists or if the plugin is not activated.

getDataServiceProxy

TvDataServiceProxy getDataServiceProxy(java.lang.String id)

createPluginContextMenu

javax.swing.JPopupMenu createPluginContextMenu(Program program,
                                               ContextMenuIf caller)
Creates a context menu for the given program containing all plugins.

Parameters:
program - The program to create the context menu for
caller - The calling plugin.
Returns:
a context menu for the given program.

getExampleProgram

Program getExampleProgram()
Returns an example program. You can use it for preview stuff.

Returns:
an example program.
Since:
0.9.7.4

handleProgramSingleClick

void handleProgramSingleClick(Program program)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a single left click on a program.

Executes the single left click context menu function. Plugins should use handleProgramDoubleClick(Program program, Plugin caller). It prevents the Plugin to be activated a second time.

Parameters:
program - The program to pass to the single left click context menu function.
Since:
2.7

handleProgramSingleClick

void handleProgramSingleClick(Program program,
                              ContextMenuIf caller)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a single left click on a program.

Executes the default context menu plugin.

Parameters:
program - The program to pass to the default context menu function.
caller - The ContextMenuIf that calls this. Prevents the ContextMenuIf to be activated twice
Since:
2.7

handleProgramSingleCtrlClick

void handleProgramSingleCtrlClick(Program program,
                                  ContextMenuIf caller)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a single left click on a program with Ctrl being held.

Executes the default context menu plugin.

Parameters:
program - The program to pass to the default context menu function.
caller - The ContextMenuIf that calls this. Prevents the ContextMenuIf to be activated twice
Since:
3.0

handleProgramDoubleClick

void handleProgramDoubleClick(Program program)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a double click on a program.

Executes the default context menu plugin. Plugins should use handleProgramDoubleClick(Program program, Plugin caller). It prevents the Plugin to be activated a second time.

Parameters:
program - The program to pass to the default context menu plugin.
Since:
1.1

handleProgramDoubleClick

void handleProgramDoubleClick(Program program,
                              ContextMenuIf caller)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a double click on a program.

Executes the default context menu plugin.

Parameters:
program - The program to pass to the default context menu plugin.
caller - The ContextMenuIf that calls this. Prevents the ContextMenuIf to be activated twice
Since:
1.1

handleProgramMiddleClick

void handleProgramMiddleClick(Program program)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a middle click on a 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.

Parameters:
program - The program to pass to the middle click context menu plugin.
Since:
1.1

handleProgramMiddleClick

void handleProgramMiddleClick(Program program,
                              ContextMenuIf caller)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a middle click on a program.

Executes the middle click context menu action.

Parameters:
program - The program to pass to the middle click context menu action.
caller - The ContextMenuIf that calls this. Prevents the ContextMenuIf to be activated twice.
Since:
1.1

handleProgramMiddleDoubleClick

void handleProgramMiddleDoubleClick(Program program)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a middle click on a program.

Executes the middle click context menu action. Plugins should use handleProgramMiddleClick(Program program, Plugin caller). It prevents the Plugin to be activated a second time.

Parameters:
program - The program to pass to the middle click context menu action.
Since:
3.0

handleProgramMiddleDoubleClick

void handleProgramMiddleDoubleClick(Program program,
                                    ContextMenuIf caller)
Deprecated. since 3.3.1 Use #ProgramMouseEventHandler and/or #ProgramKeyEventHandler instead.

Handles a middle double click on a program.

Executes the middle double click context menu action.

Parameters:
program - The program to pass to the middle double click context menu action.
caller - ContextMenuIf that calls this. Prevents the ContextMenuIf to be activated twice.
Since:
3.0

getTvBrowserSettings

TvBrowserSettings getTvBrowserSettings()
Returns some settings a plugin may need.

Returns:
Some settings a plugin may need.

getIconFromTheme

javax.swing.ImageIcon getIconFromTheme(Plugin plugin,
                                       java.lang.String category,
                                       java.lang.String icon,
                                       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. The Directory-Structure must be like this: [PackageOfYourPlugin]/icons/[Size]x[Size]/[category]/[icon].png Please try to use the FreeDesktop-Icon Naming Conventions http://cvs.freedesktop.org/[*]checkout[*]/icon-theme/default-icon-theme/spec/icon-naming-spec.xml (please remove the [ ])

Parameters:
plugin - Plugin that wants to load an Icon
category - Category of the Icon (Action, etc...)
icon - Icon-Name without File-Extension
size - Size of the Icon
Returns:
Icon if found, null if not
Since:
2.2

getIconFromTheme

javax.swing.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. The Directory-Structure must be like this: [PackageOfYourPlugin]/icons/[Size]x[Size]/[category]/[icon].png Please try to use the FreeDesktop-Icon Naming Conventions http://cvs.freedesktop.org/[*]checkout[*]/icon-theme/default-icon-theme/spec/icon-naming-spec.xml (please remove the [ ])

Parameters:
plugin - Plugin that wants to load an Icon
icon - Icon in the Icon-Theme
Returns:
Icon if found, null if not
Since:
2.2

showSettings

void showSettings(Plugin plugin)
Show the Settings-Dialog for a Plugin

Parameters:
plugin - Use this Plugin
Since:
2.2

showSettings

void showSettings(java.lang.String settingsItem)
Show the Settings-Dialog with a Specific SettingsItem

Parameters:
settingsItem - SettingsItem to show (e.g. SettingsItem.CHANNELS)
Since:
2.2

getMarkedPrograms

Program[] getMarkedPrograms()
Return all marked programs.

Returns:
The marked programs
Since:
2.2

getReceiveIfs

ProgramReceiveIf[] getReceiveIfs()
Return all Plugins/Functions that are able to receive programs.

Returns:
The ProgramReceiveIfs.
Since:
2.5

getReceiveIfs

ProgramReceiveIf[] getReceiveIfs(ProgramReceiveIf caller,
                                 ProgramReceiveTarget callerTarget)
Return all Plugins/Functions that are able to receive programs.

Parameters:
caller - The caller ProgramReceiveIf.
callerTarget - The target that calls the receive if array.
Returns:
The ProgramReceiveIfs.
Since:
2.5

getReceiceIfForId

ProgramReceiveIf getReceiceIfForId(java.lang.String id)
Return the ReceiveIfFor given id or null if there is no ReceiveIf for the given id.

Parameters:
id - The id of the ReceiveIf.
Returns:
The ReceiveIf with the given id or null
Since:
2.5

scrollToProgram

void scrollToProgram(Program program)
Let TVB scroll to the given program.

Parameters:
program - The program to scroll to.
Since:
2.5

selectProgram

void selectProgram(Program program)
Selects the given program in the program table.

Parameters:
program - The program to select.
Since:
3.1.1

scrollToTime

void scrollToTime(int time)
Let TVB scroll to the given time.

Parameters:
time - The time to scroll to in minutes.
Since:
2.5

scrollToTime

void scrollToTime(int time,
                  boolean highlight)
Let TV-Browser scroll to the given time.

Parameters:
time - The time to scroll to in minutes after midnight.
highlight - If programs at scroll time should be highlighted (if scroll highlighting is enabled.)
Since:
3.3.3

scrollToChannel

void scrollToChannel(Channel channel)
Let TVB scroll to the given channel.

Parameters:
channel - The channel to scroll to.
Since:
2.5

goToDate

void goToDate(Date date)
Let TVB change the date to the given date.

Parameters:
date - The date to show the program for.
Since:
2.5

getFilterManager

FilterManager getFilterManager()
Returns the filter manager of TV-Browser. With the filter manager you get access to the filter system of TV-Browser. You can add or remove filters of you plugin and switch the current used filter.

Don't use this method until TV-Browser is fully loaded.

Returns:
The filter manager of TV-Browser or null if TV-Browser isn't fully loaded.
Since:
2.5

getAvailableGlobalPuginProgramFormatings

AbstractPluginProgramFormating[] getAvailableGlobalPuginProgramFormatings()
Gets the available global program configurations.

Returns:
The available global program configurations.
Since:
2.5.1

getCurrentDate

Date getCurrentDate()
Get the date currently shown in the program table.

Returns:
date currently shown in program table
Since:
2.6

getAllProgramRatingIfs

ProgramRatingIf[] getAllProgramRatingIfs()
Gets all ProgramRatingIfs of all plugins. You can get all available ratings for one program.

Returns:
all ProgramRatingIfs of all plugins
Since:
2.7

deleteFileOnNextStart

void deleteFileOnNextStart(java.lang.String path)
adds a file name to the list of files to be deleted on next TV-Browser start

Parameters:
path - full file path
Since:
3.0

isDataAvailable

boolean isDataAvailable(Date date)
check if some TV data is available on the given date

Parameters:
date -
Returns:
true if at least one channel has data for the date
Since:
3.0

showBalloonTip

boolean showBalloonTip(java.lang.String caption,
                       java.lang.String message,
                       java.awt.TrayIcon.MessageType messageType)
Shows a balloon tip on the TV-Browser tray icon.

Parameters:
caption - The caption of the displayed message.
message - The message to display in the balloon tip.
messageType - The java.awt.TrayIcon.MessageType of the displayed balllon tip.
Returns:
If the balloon tip could be shown.
Since:
3.0

getTVBrowserVersion

Version getTVBrowserVersion()
Returns:
The Version of TV-Browser
Since:
3.0

createRemovedProgramContextMenu

javax.swing.JPopupMenu createRemovedProgramContextMenu(Program program)
Creates a context menu for the given program. It can be used to provide search and scroll function to programs that were removed on data update.

Parameters:
program - The removed program to create the context menu for
Returns:
A context menu for the given program.
Since:
3.2

isTvBrowserStartFinished

boolean isTvBrowserStartFinished()
Gets if TV-Browser start was finished.

Returns:
true if TV-Browser start was finished, false otherwise.
Since:
3.2.1

TV-Browser 3.3.3 API

TV-Browser 3.3.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)