TV-Browser 2.7.5 API

tvbrowser.core.plugin
Class JavaPluginProxy

java.lang.Object
  extended by tvbrowser.core.plugin.AbstractPluginProxy
      extended by tvbrowser.core.plugin.JavaPluginProxy
All Implemented Interfaces:
ContextMenuIf, Marker, PluginAccess, ProgramReceiveIf, ButtonActionIf, PluginProxy

public class JavaPluginProxy
extends AbstractPluginProxy

A plugin proxy for Java plugins.

Author:
Til Schneider, www.murfman.de

Nested Class Summary
 
Nested classes/interfaces inherited from interface tvbrowser.core.plugin.PluginProxy
PluginProxy.Comparator
 
Field Summary
 
Fields inherited from class tvbrowser.core.plugin.AbstractPluginProxy
mLocalizer
 
Constructor Summary
JavaPluginProxy(PluginInfo info, String pluginFileName, String pluginId, Icon pluginIcon)
           
JavaPluginProxy(PluginInfo info, String pluginFileName, String pluginId, String iconFileName)
           
JavaPluginProxy(Plugin plugin, String pluginFileName)
           
 
Method Summary
protected  boolean doCanReceivePrograms()
          Deprecated. Since 2.5
protected  boolean doCanReceiveProgramsWithTarget()
          Really gets whether the plugin supports receiving programs from other plugins with target.
 boolean doCanUseProgramTree()
           
protected  PluginsProgramFilter[] doGetAvailableFilter()
          Really returns the available program filters that the plugin supports.
protected  Class<? extends PluginsFilterComponent>[] doGetAvailableFilterComponentClasses()
          Really gets the available filter component classes.
protected  ActionMenu doGetButtonAction()
          Really gets the action to use for the main menu and the toolbar.
protected  PluginInfo doGetInfo()
          Really gets the meta information about the plugin.
protected  Icon[] doGetMarkIcons(Program p)
          Really gets the icons to use for marking programs in the program table.
protected  int doGetMarkPriorityForProgram(Program p)
          Really gets the mark priority for the given Program.
protected  ProgramReceiveTarget[] doGetProgramReceiveTargets()
          Really return an array of receive target or null if there is no target
protected  Icon[] doGetProgramTableIcons(Program program)
          Really gets the icons this Plugin provides for the given program.
protected  String doGetProgramTableIconText()
          Gets the description text for the program table icons provided by this Plugin.
protected  SettingsTabProxy doGetSettingsTab()
          Really gets the SettingsTab object, which is added to the settings-window.
protected  void doHandleTvBrowserStartFinished()
          This method is automatically called, when the TV-Browser start is complete.
protected  void doHandleTvDataAdded(ChannelDayProgram newProg)
          This method is automatically called, when TV data was added.
protected  void doHandleTvDataAdded(MutableChannelDayProgram newProg)
          This method is automatically called, when TV data was added.
protected  void doHandleTvDataDeleted(ChannelDayProgram oldProg)
          This method is automatically called, when TV data was deleted.
protected  void doHandleTvDataTouched(ChannelDayProgram removedDayProgram, ChannelDayProgram addedDayProgram)
          This method is automatically called, when TV data was added.
protected  void doHandleTvDataUpdateFinished()
          This method is automatically called, when the TV data update is finished.
protected  boolean doIsAllowedToDeleteProgramFilter(PluginsProgramFilter programFilter)
          Really return if a program filter can be deleted.
protected  void doLoadSettings(File userDirectory)
          Really loads the settings for this plugin.
 void doOnActivation()
           
 void doOnDeactivation()
           
protected  void doReceivePrograms(Program[] programArr)
          Deprecated. Since 2.5
protected  boolean doReceivePrograms(Program[] programArr, ProgramReceiveTarget receiveTarget)
          Really receives a list of programs from another plugin with target.
protected  boolean doReceiveValues(String[] values, ProgramReceiveTarget receiveTarget)
          Really receives a list of Strings from another plugin with a target.
protected  void doSaveSettings(File userDirectory, boolean log)
          Really saves the settings for this plugin.
 String getButtonActionDescription()
          Gets the description for this ButtonActionIf.
 String getId()
          Gets the ID of this plugin.
static String getJavaPluginId(Plugin javaPlugin)
          Gets the ID of the given Java plugin.
 String getPluginFileName()
          return the file name of the plugin contained in this proxy
 Icon getPluginIcon()
          get the icon to represent this plugin in the settings
 ProgramRatingIf[] getProgramRatingIfs()
          If this plugin can rate programs, this interface makes it possible to offer this ratings to other plugins.
 PluginTreeNode getRootNode()
           
protected  ActionMenu goGetContextMenuActions(Program program)
          Gets the actions for the context menu of a program.
(package private)  void setParentFrame(Frame parent)
          Sets the parent frame to the plugin.
 void setPlugin(Plugin plugin, String fileName)
          connect a lazy loaded plugin to its proxy
 
Methods inherited from class tvbrowser.core.plugin.AbstractPluginProxy
addToArtificialPluginTree, assertActivatedState, canReceivePrograms, canReceiveProgramsWithTarget, canUseProgramTree, getArtificialRootNode, getAvailableFilter, getAvailableFilterComponentClasses, getButtonAction, getContextMenuActions, getInfo, getMarkIcon, getMarkIcons, getMarkPriorityForProgram, getProgramReceiveTargets, getProgramTableIcons, getProgramTableIconText, getSettingsTab, handlePluginException, handleTvBrowserStartFinished, handleTvDataAdded, handleTvDataAdded, handleTvDataDeleted, handleTvDataTouched, handleTvDataUpdateFinished, hasArtificialPluginTree, isActivated, isAllowedToDeleteProgramFilter, loadSettings, onActivation, onDeactivation, receivePrograms, receivePrograms, receiveValues, removeArtificialPluginTree, saveSettings, setActivated, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaPluginProxy

public JavaPluginProxy(Plugin plugin,
                       String pluginFileName)

JavaPluginProxy

public JavaPluginProxy(PluginInfo info,
                       String pluginFileName,
                       String pluginId,
                       Icon pluginIcon)

JavaPluginProxy

public JavaPluginProxy(PluginInfo info,
                       String pluginFileName,
                       String pluginId,
                       String iconFileName)
Method Detail

getJavaPluginId

public static 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.

getId

public String getId()
Gets the ID of this plugin.

Returns:
The ID of this plugin.

setParentFrame

void setParentFrame(Frame parent)
Sets the parent frame to the plugin.

Specified by:
setParentFrame in class AbstractPluginProxy
Parameters:
parent - The parent frame to set.

doLoadSettings

protected void doLoadSettings(File userDirectory)
                       throws TvBrowserException
Really loads the settings for this plugin.

Specified by:
doLoadSettings in class AbstractPluginProxy
Parameters:
userDirectory - The directory where the user data is stored.
Throws:
TvBrowserException - If loading failed.

doSaveSettings

protected void doSaveSettings(File userDirectory,
                              boolean log)
                       throws TvBrowserException
Really saves the settings for this plugin.

Specified by:
doSaveSettings in class AbstractPluginProxy
Parameters:
userDirectory - The directory where the user data is stored.
Throws:
TvBrowserException - If saving failed.

doGetInfo

protected PluginInfo doGetInfo()
Really gets the meta information about the plugin.

Specified by:
doGetInfo in class AbstractPluginProxy
Returns:
The meta information about the plugin.

doCanReceivePrograms

protected boolean doCanReceivePrograms()
Deprecated. Since 2.5

Really gets whether the plugin supports receiving programs from other plugins.

Specified by:
doCanReceivePrograms in class AbstractPluginProxy
Returns:
Whether the plugin supports receiving programs from other plugins.
See Also:
AbstractPluginProxy.receivePrograms(Program[])

doReceivePrograms

protected void doReceivePrograms(Program[] programArr)
Deprecated. Since 2.5

Really receives a list of programs from another plugin.

Specified by:
doReceivePrograms in class AbstractPluginProxy
Parameters:
programArr - The programs passed from the other plugin.
See Also:
AbstractPluginProxy.canReceivePrograms()

doGetSettingsTab

protected SettingsTabProxy doGetSettingsTab()
Really gets the SettingsTab object, which is added to the settings-window.

Specified by:
doGetSettingsTab in class AbstractPluginProxy
Returns:
the SettingsTab object or null if the plugin does not provide this feature.

goGetContextMenuActions

protected ActionMenu goGetContextMenuActions(Program program)
Gets the actions for the context menu of a program.

Specified by:
goGetContextMenuActions in class AbstractPluginProxy
Parameters:
program - The program the context menu will be shown for.
Returns:
the actions this plugin provides for the given program or null if the plugin does not provide this feature.
See Also:
AbstractPluginProxy.getContextMenuActions(Program)

doGetButtonAction

protected ActionMenu doGetButtonAction()
Really gets the action to use for the main menu and the toolbar.

Specified by:
doGetButtonAction in class AbstractPluginProxy
Returns:
the action to use for the menu and the toolbar or null if the plugin does not provide this feature.
See Also:
AbstractPluginProxy.getButtonAction()

doGetMarkIcons

protected Icon[] doGetMarkIcons(Program p)
Really gets the icons to use for marking programs in the program table.

Specified by:
doGetMarkIcons in class AbstractPluginProxy
Returns:
the icons to use for marking programs in the program table.

doGetProgramTableIconText

protected String doGetProgramTableIconText()
Gets the description text for the program table icons provided by this Plugin.

Return null if your plugin does not provide this feature.

Specified by:
doGetProgramTableIconText in class AbstractPluginProxy
Returns:
The description text for the program table icons or null if the plugin does not provide this feature.
See Also:
AbstractPluginProxy.getProgramTableIcons(Program)

doGetProgramTableIcons

protected Icon[] doGetProgramTableIcons(Program program)
Really gets the icons this Plugin provides for the given program. These icons will be shown in the program table under the start time.

Return null if your plugin does not provide this feature.

Specified by:
doGetProgramTableIcons in class AbstractPluginProxy
Parameters:
program - The programs to get the icons for.
Returns:
The icons for the given program or null.
See Also:
AbstractPluginProxy.getProgramTableIconText()

doHandleTvDataUpdateFinished

protected void doHandleTvDataUpdateFinished()
This method is automatically called, when the TV data update is finished.

Specified by:
doHandleTvDataUpdateFinished in class AbstractPluginProxy
See Also:
AbstractPluginProxy.handleTvDataAdded(ChannelDayProgram), AbstractPluginProxy.handleTvDataDeleted(ChannelDayProgram)

doHandleTvDataAdded

protected void doHandleTvDataAdded(ChannelDayProgram newProg)
This method is automatically called, when TV data was added. (E.g. after an update).

The TV data may be modified by the plugin! So this method must be called before new TV data is saved.

Specified by:
doHandleTvDataAdded in class AbstractPluginProxy
Parameters:
newProg - The new ChannelDayProgram.
See Also:
AbstractPluginProxy.handleTvDataDeleted(ChannelDayProgram), AbstractPluginProxy.handleTvDataUpdateFinished()

doHandleTvDataDeleted

protected void doHandleTvDataDeleted(ChannelDayProgram oldProg)
This method is automatically called, when TV data was deleted. (E.g. after an update).

Specified by:
doHandleTvDataDeleted in class AbstractPluginProxy
Parameters:
oldProg - The old ChannelDayProgram which was deleted.
See Also:
AbstractPluginProxy.handleTvDataAdded(ChannelDayProgram), AbstractPluginProxy.handleTvDataUpdateFinished()

doHandleTvBrowserStartFinished

protected void doHandleTvBrowserStartFinished()
This method is automatically called, when the TV-Browser start is complete.

Specified by:
doHandleTvBrowserStartFinished in class AbstractPluginProxy

doOnActivation

public void doOnActivation()
Specified by:
doOnActivation in class AbstractPluginProxy

doOnDeactivation

public void doOnDeactivation()
Specified by:
doOnDeactivation in class AbstractPluginProxy

doCanUseProgramTree

public boolean doCanUseProgramTree()
Specified by:
doCanUseProgramTree in class AbstractPluginProxy

getRootNode

public PluginTreeNode getRootNode()

doCanReceiveProgramsWithTarget

protected boolean doCanReceiveProgramsWithTarget()
Really gets whether the plugin supports receiving programs from other plugins with target.

Specified by:
doCanReceiveProgramsWithTarget in class AbstractPluginProxy
Returns:
Whether the plugin supports receiving programs from other plugins with target.
Since:
2.5
See Also:
AbstractPluginProxy.receivePrograms(Program[],ProgramReceiveTarget)

doReceivePrograms

protected boolean doReceivePrograms(Program[] programArr,
                                    ProgramReceiveTarget receiveTarget)
Really receives a list of programs from another plugin with target.

Specified by:
doReceivePrograms in class AbstractPluginProxy
Parameters:
programArr - The programs passed from the other plugin with target.
receiveTarget - The target of the programs.
Since:
2.5
See Also:
AbstractPluginProxy.canReceiveProgramsWithTarget()

doGetProgramReceiveTargets

protected ProgramReceiveTarget[] doGetProgramReceiveTargets()
Really return an array of receive target or null if there is no target

Specified by:
doGetProgramReceiveTargets in class AbstractPluginProxy
Returns:
The supported receive targets.
Since:
2.5
See Also:
AbstractPluginProxy.canReceiveProgramsWithTarget(), AbstractPluginProxy.receivePrograms(Program[],ProgramReceiveTarget)

doGetAvailableFilter

protected PluginsProgramFilter[] doGetAvailableFilter()
Really returns the available program filters that the plugin supports.

Specified by:
doGetAvailableFilter in class AbstractPluginProxy
Returns:
The available program filters that the plugin supports or null if it supports no filter.
Since:
2.5

doIsAllowedToDeleteProgramFilter

protected boolean doIsAllowedToDeleteProgramFilter(PluginsProgramFilter programFilter)
Really return if a program filter can be deleted.

Specified by:
doIsAllowedToDeleteProgramFilter in class AbstractPluginProxy
Parameters:
programFilter - The program filter to delete.
Returns:
True if the program filter component can be deleted.
Since:
2.5

doGetAvailableFilterComponentClasses

protected Class<? extends PluginsFilterComponent>[] doGetAvailableFilterComponentClasses()
Really gets the available filter component classes.

Specified by:
doGetAvailableFilterComponentClasses in class AbstractPluginProxy
Returns:
The available plugins filter components classes or null if no plugins filter components are supported.
Since:
2.5

doGetMarkPriorityForProgram

protected int doGetMarkPriorityForProgram(Program p)
Really gets the mark priority for the given Program.

Specified by:
doGetMarkPriorityForProgram in class AbstractPluginProxy
Parameters:
p - The program to get the mark priority for.
Returns:
The mark priority for the given program.

getPluginFileName

public String getPluginFileName()
Description copied from interface: PluginProxy
return the file name of the plugin contained in this proxy

Returns:
file name

setPlugin

public void setPlugin(Plugin plugin,
                      String fileName)
connect a lazy loaded plugin to its proxy

Parameters:
plugin -

getPluginIcon

public Icon getPluginIcon()
Description copied from interface: PluginProxy
get the icon to represent this plugin in the settings

Specified by:
getPluginIcon in interface PluginProxy
Overrides:
getPluginIcon in class AbstractPluginProxy
Returns:
icon

getProgramRatingIfs

public ProgramRatingIf[] getProgramRatingIfs()
Description copied from interface: PluginProxy
If this plugin can rate programs, this interface makes it possible to offer this ratings to other plugins. You can get all ProgramRatingIfs of all plugins using PluginManager.getAllProgramRatingIfs() The plugin can return more than one ratingif, e.g. average ratings, user rating ...

Returns:
the RatingIfs of this plugin

getButtonActionDescription

public String getButtonActionDescription()
Description copied from interface: ButtonActionIf
Gets the description for this ButtonActionIf.

Returns:
The description for this ButtonActionIf.

doHandleTvDataAdded

protected void doHandleTvDataAdded(MutableChannelDayProgram newProg)
Description copied from class: AbstractPluginProxy
This method is automatically called, when TV data was added. (E.g. after an update).

The TV data can be modified by the plugin!

Override this method if you want to change/add data. Don't do other things than changing/adding data, use AbstractPluginProxy.handleTvDataAdded(ChannelDayProgram) istead.

Specified by:
doHandleTvDataAdded in class AbstractPluginProxy
Parameters:
newProg - The new ChannelDayProgram.
See Also:
AbstractPluginProxy.handleTvDataDeleted(ChannelDayProgram), #handleTvDataChanged()

doReceiveValues

protected boolean doReceiveValues(String[] values,
                                  ProgramReceiveTarget receiveTarget)
Description copied from class: AbstractPluginProxy
Really receives a list of Strings from another plugin with a target.

Specified by:
doReceiveValues in class AbstractPluginProxy
Parameters:
values - The value array passed from the other plugin.
Returns:
True if the value array was handled correct, false otherwise.
See Also:
AbstractPluginProxy.canReceiveProgramsWithTarget()

doHandleTvDataTouched

protected void doHandleTvDataTouched(ChannelDayProgram removedDayProgram,
                                     ChannelDayProgram addedDayProgram)
Description copied from class: AbstractPluginProxy
This method is automatically called, when TV data was added. (E.g. after an update).

The TV data may be modified by the plugin! So this method must be called before new TV data is saved.

Specified by:
doHandleTvDataTouched in class AbstractPluginProxy
See Also:
AbstractPluginProxy.handleTvDataAdded(ChannelDayProgram), AbstractPluginProxy.handleTvDataDeleted(ChannelDayProgram), AbstractPluginProxy.handleTvDataUpdateFinished()

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)