- java.lang.Object
-
- tvbrowser.core.plugin.AbstractPluginProxy
-
- tvbrowser.core.plugin.BeanShellPluginProxy
-
- All Implemented Interfaces:
ContextMenuIf
,InfoIf
,Marker
,PluginAccess
,ProgramReceiveIf
,java.lang.Comparable<ProgramReceiveIf>
,ButtonActionIf
,PluginProxy
public class BeanShellPluginProxy extends AbstractPluginProxy
- Author:
- bodum
-
-
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
DEFAULT_PLUGIN_ICON_NAME, mLocalizer
-
Fields inherited from interface devplugin.ContextMenuIf
ACTIONKEY_KEYBOARD_EVENT
-
-
Constructor Summary
Constructors Constructor Description BeanShellPluginProxy(java.io.File bshFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
doCanReceiveProgramsWithTarget()
Really gets whether the plugin supports receiving programs from other plugins with target.boolean
doCanUseProgramTree()
ProgramInfo[]
doGetAddtionalProgramInfoForProgram(Program p, java.lang.String uniqueId)
protected boolean
doGetAllowsArtificialPluginTree()
protected PluginsProgramFilter[]
doGetAvailableFilter()
Really returns the available program filters that the plugin supports.protected java.lang.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.PluginCommunication
doGetCommunicationClass()
protected ActionMenu
doGetContextMenuActions(Channel channel)
Really gets the actions for the context menu of a channel.protected ActionMenu
doGetContextMenuActions(Program program)
Really gets the actions for the context menu of a program.protected ImportanceValue
doGetImportanceValueForProgram(Program p)
Gets the importance value of a program.The importance of all active plugins is used to determinate the opacity of the used colors of a program, therefor a mean value of all values is used.protected PluginInfo
doGetInfo()
Really gets the meta information about the plugin.protected javax.swing.Icon[]
doGetMarkIcons(Program p)
Really gets the icon to use for marking programs in the program table.protected int[]
doGetMarkPrioritiesForProgram(Program p)
Really gets the mark priority for the given Program.protected int
doGetMarkPriorityMaxForProgram(Program p)
Really gets the mark priority for the given Program.protected ProgramReceiveTarget[]
doGetProgramReceiveTargets()
Really return an array of receive target ornull
if there is no targetprotected javax.swing.Icon[]
doGetProgramTableIcons(Program program)
Really gets the icons this Plugin provides for the given program.protected java.lang.String
doGetProgramTableIconText()
Gets the description text for the program table icons provided by this Plugin.protected ToolTipIcon[]
doGetProgramTableToolTipIcons(Program program)
Gets the ToolTipIcons for the program table icons provided by this Plugin.protected SettingsTabProxy
doGetSettingsTab()
Rally gets the SettingsTab object, which is added to the settings-window.protected void
doHandleTvBrowserStartFinished()
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 touched.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(java.io.File userDirectory)
Really loads the settings for this plugin.void
doOnActivation()
void
doOnDeactivation()
protected boolean
doReceivePrograms(int type, Program[] programArr, ProgramReceiveTarget receiveTarget)
Really receives a list of programs from another plugin with target.protected boolean
doReceiveValues(int type, java.lang.String[] values, ProgramReceiveTarget receiveTarget)
Really receives a list of Strings from another plugin with a target.protected void
doSaveSettings(java.io.File userDirectory)
protected void
doSaveSettings(java.io.File userDirectory, boolean log)
Really saves the settings for this plugin.AfterDataUpdateInfoPanel
getAfterDataUpdateInfoPanel()
Gets a panel that contains infos that should be shown for this Plugins after a data update.java.lang.String
getButtonActionDescription()
Gets the description for this ButtonActionIf.java.lang.String
getId()
Gets the ID of this plugin.java.lang.String
getPluginCategory()
PluginCenterPanelWrapper
getPluginCenterPanelWrapper()
Gets the PluginCenterPanelWrapper for this plugin.java.lang.String
getPluginFileName()
return the file name of the plugin contained in this proxyProgramRatingIf[]
getProgramRatingIfs()
If this plugin can rate programs, this interface makes it possible to offer this ratings to other plugins.PluginTreeNode
getRootNode()
void
handleTvBrowserSettingsChanged()
Is called when settings of TV-Browser or Plugins were changed, so this Plugin can react on that change.void
handleTvDataUpdateStarted(Date until)
Is called when a TV data update is started.boolean
receivePrograms(Program[] programArr, ProgramReceiveTarget receiveTarget)
Deprecated.boolean
receiveValues(java.lang.String[] values, ProgramReceiveTarget receiveTarget)
Deprecated.(package private) void
setParentFrame(java.awt.Frame parent)
Sets the parent frame to the plugin.-
Methods inherited from class tvbrowser.core.plugin.AbstractPluginProxy
addToArtificialPluginTree, assertActivatedState, canReceiveProgramsWithTarget, canUseProgramTree, compareTo, getAddtionalProgramInfoForProgram, getArtificialRootNode, getAvailableFilter, getAvailableFilterComponentClasses, getButtonAction, getCommunicationClass, getContextMenuActions, getContextMenuActions, getImportanceValueForProgram, getInfo, getMarkIcon, getMarkIcons, getMarkPrioritiesForProgram, getMarkPriorityForProgram, getMarkPriorityMaxForProgram, getPluginIcon, getProgramReceiveTargets, getProgramTableIcons, getProgramTableIconText, getProgramTableToolTipIcons, getSettingsTab, handlePluginException, handleTvBrowserStartFinished, handleTvDataAdded, handleTvDataAdded, handleTvDataDeleted, handleTvDataTouched, handleTvDataUpdateFinished, hasArtificialPluginTree, isActivated, isAllowedToDeleteProgramFilter, loadSettings, onActivation, onDeactivation, receivePrograms, receiveValues, removeArtificialPluginTree, saveSettings, setActivated, toString
-
-
-
-
Method Detail
-
setParentFrame
void setParentFrame(java.awt.Frame parent)
Description copied from class:AbstractPluginProxy
Sets the parent frame to the plugin.- Specified by:
setParentFrame
in classAbstractPluginProxy
- Parameters:
parent
- The parent frame to set.
-
doLoadSettings
protected void doLoadSettings(java.io.File userDirectory) throws TvBrowserException
Description copied from class:AbstractPluginProxy
Really loads the settings for this plugin.- Specified by:
doLoadSettings
in classAbstractPluginProxy
- Parameters:
userDirectory
- The directory where the user data is stored.- Throws:
TvBrowserException
- If loading failed.
-
doSaveSettings
protected void doSaveSettings(java.io.File userDirectory) throws TvBrowserException
- Throws:
TvBrowserException
-
doSaveSettings
protected void doSaveSettings(java.io.File userDirectory, boolean log) throws TvBrowserException
Description copied from class:AbstractPluginProxy
Really saves the settings for this plugin.- Specified by:
doSaveSettings
in classAbstractPluginProxy
- Parameters:
userDirectory
- The directory where the user data is stored.log
- If log entries should be written.- Throws:
TvBrowserException
- If saving failed.
-
doGetInfo
protected PluginInfo doGetInfo()
Description copied from class:AbstractPluginProxy
Really gets the meta information about the plugin.- Specified by:
doGetInfo
in classAbstractPluginProxy
- Returns:
- The meta information about the plugin.
-
doGetSettingsTab
protected SettingsTabProxy doGetSettingsTab()
Description copied from class:AbstractPluginProxy
Rally gets the SettingsTab object, which is added to the settings-window.- Specified by:
doGetSettingsTab
in classAbstractPluginProxy
- Returns:
- the SettingsTab object or
null
if the plugin does not provide this feature.
-
doGetContextMenuActions
protected ActionMenu doGetContextMenuActions(Program program)
Description copied from class:AbstractPluginProxy
Really gets the actions for the context menu of a program.- Specified by:
doGetContextMenuActions
in classAbstractPluginProxy
- 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)
-
doGetContextMenuActions
protected ActionMenu doGetContextMenuActions(Channel channel)
Description copied from class:AbstractPluginProxy
Really gets the actions for the context menu of a channel.- Specified by:
doGetContextMenuActions
in classAbstractPluginProxy
- Parameters:
channel
- The channel the context menu will be shown for.- Returns:
- the actions this plugin provides for the given channel or
null
if the plugin does not provide this feature. - See Also:
AbstractPluginProxy.getContextMenuActions(Program)
-
doGetButtonAction
protected ActionMenu doGetButtonAction()
Description copied from class:AbstractPluginProxy
Really gets the action to use for the main menu and the toolbar.- Specified by:
doGetButtonAction
in classAbstractPluginProxy
- 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 javax.swing.Icon[] doGetMarkIcons(Program p)
Description copied from class:AbstractPluginProxy
Really gets the icon to use for marking programs in the program table.- Specified by:
doGetMarkIcons
in classAbstractPluginProxy
- Parameters:
p
- The program to get the mark icons for.- Returns:
- the icon to use for marking programs in the program table.
-
doGetProgramTableIconText
protected java.lang.String doGetProgramTableIconText()
Description copied from class:AbstractPluginProxy
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 classAbstractPluginProxy
- 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 javax.swing.Icon[] doGetProgramTableIcons(Program program)
Description copied from class:AbstractPluginProxy
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 classAbstractPluginProxy
- 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()
Description copied from class:AbstractPluginProxy
This method is automatically called, when the TV data update is finished.
-
doHandleTvDataAdded
protected void doHandleTvDataAdded(ChannelDayProgram newProg)
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:
doHandleTvDataAdded
in classAbstractPluginProxy
- Parameters:
newProg
- The new ChannelDayProgram.- See Also:
AbstractPluginProxy.handleTvDataDeleted(ChannelDayProgram)
,AbstractPluginProxy.handleTvDataUpdateFinished()
-
doHandleTvBrowserStartFinished
protected void doHandleTvBrowserStartFinished()
- Specified by:
doHandleTvBrowserStartFinished
in classAbstractPluginProxy
-
doHandleTvDataDeleted
protected void doHandleTvDataDeleted(ChannelDayProgram oldProg)
Description copied from class:AbstractPluginProxy
This method is automatically called, when TV data was deleted. (E.g. after an update).- Specified by:
doHandleTvDataDeleted
in classAbstractPluginProxy
- Parameters:
oldProg
- The old ChannelDayProgram which was deleted.- See Also:
AbstractPluginProxy.handleTvDataAdded(ChannelDayProgram)
,AbstractPluginProxy.handleTvDataUpdateFinished()
-
getId
public java.lang.String getId()
Description copied from interface:PluginAccess
Gets the ID of this plugin.- Returns:
- The ID of this plugin.
-
doOnActivation
public void doOnActivation()
- Specified by:
doOnActivation
in classAbstractPluginProxy
-
doOnDeactivation
public void doOnDeactivation()
- Specified by:
doOnDeactivation
in classAbstractPluginProxy
-
doCanUseProgramTree
public boolean doCanUseProgramTree()
- Specified by:
doCanUseProgramTree
in classAbstractPluginProxy
-
getRootNode
public PluginTreeNode getRootNode()
-
doCanReceiveProgramsWithTarget
protected boolean doCanReceiveProgramsWithTarget()
Description copied from class:AbstractPluginProxy
Really gets whether the plugin supports receiving programs from other plugins with target.- Specified by:
doCanReceiveProgramsWithTarget
in classAbstractPluginProxy
- Returns:
- Whether the plugin supports receiving programs from other plugins with target.
- See Also:
ProgramReceiveIf.receivePrograms(Program[],ProgramReceiveTarget)
-
doReceivePrograms
protected boolean doReceivePrograms(int type, Program[] programArr, ProgramReceiveTarget receiveTarget)
Description copied from class:AbstractPluginProxy
Really receives a list of programs from another plugin with target.- Specified by:
doReceivePrograms
in classAbstractPluginProxy
- Parameters:
type
- The type set by the sending plugin.programArr
- The programs passed from the other plugin with target.receiveTarget
- The target of the programs.- Returns:
true
If the received programs were successfully processed.- See Also:
AbstractPluginProxy.canReceiveProgramsWithTarget()
-
doGetProgramReceiveTargets
protected ProgramReceiveTarget[] doGetProgramReceiveTargets()
Description copied from class:AbstractPluginProxy
Really return an array of receive target ornull
if there is no target- Specified by:
doGetProgramReceiveTargets
in classAbstractPluginProxy
- Returns:
- The supported receive targets.
- See Also:
AbstractPluginProxy.canReceiveProgramsWithTarget()
,ProgramReceiveIf.receivePrograms(Program[],ProgramReceiveTarget)
-
doGetAvailableFilter
protected PluginsProgramFilter[] doGetAvailableFilter()
Description copied from class:AbstractPluginProxy
Really returns the available program filters that the plugin supports.- Specified by:
doGetAvailableFilter
in classAbstractPluginProxy
- Returns:
- The available program filters that the plugin supports or
null
if it supports no filter.
-
doIsAllowedToDeleteProgramFilter
protected boolean doIsAllowedToDeleteProgramFilter(PluginsProgramFilter programFilter)
Description copied from class:AbstractPluginProxy
Really return if a program filter can be deleted.- Specified by:
doIsAllowedToDeleteProgramFilter
in classAbstractPluginProxy
- Parameters:
programFilter
- The program filter to delete.- Returns:
- True if the program filter component can be deleted.
-
doGetAvailableFilterComponentClasses
protected java.lang.Class<? extends PluginsFilterComponent>[] doGetAvailableFilterComponentClasses()
Description copied from class:AbstractPluginProxy
Really gets the available filter component classes.- Specified by:
doGetAvailableFilterComponentClasses
in classAbstractPluginProxy
- Returns:
- The available plugins filter components classes or
null
if no plugins filter components are supported.
-
doGetMarkPriorityMaxForProgram
protected int doGetMarkPriorityMaxForProgram(Program p)
Description copied from class:AbstractPluginProxy
Really gets the mark priority for the given Program.- Specified by:
doGetMarkPriorityMaxForProgram
in classAbstractPluginProxy
- Parameters:
p
- The program to get the mark priority for.- Returns:
- The mark priority for the given program.
-
getPluginFileName
public java.lang.String getPluginFileName()
Description copied from interface:PluginProxy
return the file name of the plugin contained in this proxy- Returns:
- file name
-
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 usingPluginManager.getAllProgramRatingIfs()
The plugin can return more than one ratingif, e.g. average ratings, user rating ...- Returns:
- the RatingIfs of this plugin
-
getButtonActionDescription
public java.lang.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)
instead.- Specified by:
doHandleTvDataAdded
in classAbstractPluginProxy
- Parameters:
newProg
- The new ChannelDayProgram.- See Also:
AbstractPluginProxy.handleTvDataDeleted(ChannelDayProgram)
,AbstractPluginProxy.handleTvDataTouched(ChannelDayProgram, ChannelDayProgram)
-
doReceiveValues
protected boolean doReceiveValues(int type, java.lang.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 classAbstractPluginProxy
- Parameters:
type
- The type set by the sending plugin.values
- The value array passed from the other plugin.receiveTarget
- The receive target of the programs.- Returns:
true
if the value array was handled correct,false
otherwise.- See Also:
#getSupportedProgramRecieveType()
-
doHandleTvDataTouched
protected void doHandleTvDataTouched(ChannelDayProgram removedDayProgram, ChannelDayProgram addedDayProgram)
Description copied from class:AbstractPluginProxy
This method is automatically called, when TV data was touched. (E.g. after an update of already existing TV data).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 classAbstractPluginProxy
- Parameters:
removedDayProgram
- The previous ChannelDayProgram.addedDayProgram
- The new ChannelDayProgram.- See Also:
AbstractPluginProxy.handleTvDataAdded(ChannelDayProgram)
,AbstractPluginProxy.handleTvDataDeleted(ChannelDayProgram)
,AbstractPluginProxy.handleTvDataUpdateFinished()
-
doGetImportanceValueForProgram
protected ImportanceValue doGetImportanceValueForProgram(Program p)
Description copied from class:AbstractPluginProxy
Gets the importance value of a program.The importance of all active plugins is used to determinate the opacity of the used colors of a program, therefor a mean value of all values is used.The importance value can be created as a weighted total of the following values.
- Specified by:
doGetImportanceValueForProgram
in classAbstractPluginProxy
- Parameters:
p
- The program to get the importance value for.- Returns:
- The importance value for the given program.
-
getPluginCategory
public java.lang.String getPluginCategory()
-
getPluginCenterPanelWrapper
public PluginCenterPanelWrapper getPluginCenterPanelWrapper()
Description copied from interface:PluginProxy
Gets the PluginCenterPanelWrapper for this plugin.- Returns:
- The
PluginCenterPanelWrapper
for this plugin ornull
.
-
getAfterDataUpdateInfoPanel
public AfterDataUpdateInfoPanel getAfterDataUpdateInfoPanel()
Description copied from interface:PluginProxy
Gets a panel that contains infos that should be shown for this Plugins after a data update.- Returns:
- The panel with the infos.
-
handleTvBrowserSettingsChanged
public void handleTvBrowserSettingsChanged()
Description copied from interface:PluginProxy
Is called when settings of TV-Browser or Plugins were changed, so this Plugin can react on that change.
-
handleTvDataUpdateStarted
public void handleTvDataUpdateStarted(Date until)
Description copied from interface:PluginProxy
Is called when a TV data update is started.- Parameters:
until
- The last date the data is updated for.
-
doGetCommunicationClass
public PluginCommunication doGetCommunicationClass()
- Specified by:
doGetCommunicationClass
in classAbstractPluginProxy
-
doGetAllowsArtificialPluginTree
protected boolean doGetAllowsArtificialPluginTree()
- Specified by:
doGetAllowsArtificialPluginTree
in classAbstractPluginProxy
-
doGetProgramTableToolTipIcons
protected ToolTipIcon[] doGetProgramTableToolTipIcons(Program program)
Description copied from class:AbstractPluginProxy
Gets the ToolTipIcons for the program table icons provided by this Plugin.Override this method if your plugin provides icons for the program table (shown below the start time) and you want the icons to be shown in the tooltip.
- Specified by:
doGetProgramTableToolTipIcons
in classAbstractPluginProxy
- Parameters:
program
- The program to get the ToolTipIcons for.- Returns:
- The description text for the program table icons or
null
if the plugin does not provide this feature. - See Also:
AbstractPluginProxy.getProgramTableIcons(Program)
-
doGetAddtionalProgramInfoForProgram
public ProgramInfo[] doGetAddtionalProgramInfoForProgram(Program p, java.lang.String uniqueId)
- Specified by:
doGetAddtionalProgramInfoForProgram
in classAbstractPluginProxy
-
receivePrograms
@Deprecated(since="4.2.2") public boolean receivePrograms(Program[] programArr, ProgramReceiveTarget receiveTarget)
Deprecated.Description copied from interface:ProgramReceiveIf
Receives a list of programs from another plugin with a target.- Parameters:
programArr
- The programs passed from the other plugin.receiveTarget
- The receive target of the programs.- Returns:
true
, if the programs were correctly received and the target really exists.- See Also:
ProgramReceiveIf.canReceiveProgramsWithTarget()
-
receiveValues
@Deprecated(since="4.2.2") public boolean receiveValues(java.lang.String[] values, ProgramReceiveTarget receiveTarget)
Deprecated.Description copied from interface:ProgramReceiveIf
Receives a list of Strings from another plugin with a target.- Parameters:
values
- The value array passed from the other plugin.receiveTarget
- The receive target of the programs.- Returns:
True
if the value array was handled correct,false
otherwise.- See Also:
ProgramReceiveIf.canReceiveProgramsWithTarget()
-
doGetMarkPrioritiesForProgram
protected int[] doGetMarkPrioritiesForProgram(Program p)
Description copied from class:AbstractPluginProxy
Really gets the mark priority for the given Program.- Specified by:
doGetMarkPrioritiesForProgram
in classAbstractPluginProxy
- Parameters:
p
- The program to get the mark priority for.- Returns:
- The mark priority for the given program.
-
-