public class TVRaterPlugin extends Plugin
Modifier and Type | Field and Description |
---|---|
protected static int |
MINLENGTH |
BIG_ICON, DISABLED_ON_TASK_MENU, parent, SINGLE_CLICK_WAITING_TIME
Constructor and Description |
---|
TVRaterPlugin() |
Modifier and Type | Method and Description |
---|---|
boolean |
canUseProgramTree()
Signal whether this plugin participates in the plugin tree view or not.
|
PluginsProgramFilter[] |
getAvailableFilter()
Returns the available program filters that the plugin supports.
|
Class<? extends PluginsFilterComponent>[] |
getAvailableFilterComponentClasses()
Returns the available plugins filter component classes.
|
ActionMenu |
getButtonAction()
Gets the action to use for the main menu and the toolbar.
|
ActionMenu |
getContextMenuActions(Program program)
Gets the actions for the context menu of a program.
|
Database |
getDatabase()
Returns the Database for the Ratings
|
PluginInfo |
getInfo()
Gets the meta information about the plugin.
|
static TVRaterPlugin |
getInstance()
Returns an Instance of this Plugin
|
String |
getMarkIconName()
Gets the name of the file, containing your mark icon (in the jar-File).
|
Frame |
getParentFrameForTVRater()
Gets the parent frame.
|
Icon[] |
getProgramTableIcons(Program program)
Gets the icons this Plugin provides for the given program.
|
String |
getProgramTableIconText()
Gets the description text for the program table icons provided by this
Plugin.
|
Rating |
getRating(Program program)
Returns the Rating for a program.
|
ProgramRatingIf[] |
getRatingInterfaces()
If this plugin can rate programs, this interface makes it possible to offer this ratings
to other plugins.
|
PluginTreeNode |
getRootNode()
Gets the root node of the plugin for the plugin tree.
|
Properties |
getSettings()
Returns the Settings for this Plugin
|
SettingsTab |
getSettingsTab()
Gets the SettingsTab object, which is added to the settings-window.
|
static Version |
getVersion() |
void |
handleTvBrowserStartFinished()
This method is called when the TV-Browser start is finished.
|
void |
handleTvDataUpdateFinished()
This method is automatically called, when the TV data update is finished.
|
boolean |
isProgramRateable(Program program)
Returns true if Program is rateable (Length > MINLENGTH or last Program of Day)
|
void |
loadSettings(Properties settings)
Called by the host-application during start-up.
|
void |
onActivation()
This method is automatically called immediatly before the plugin gets
activated.
|
void |
readData(ObjectInputStream in)
Called by the host-application during start-up.
|
void |
showDialog()
This method is invoked by the host-application if the user has choosen
your plugin from the menu.
|
void |
showRatingDialog(Program program) |
Properties |
storeSettings()
Called by the host-application during shut-down.
|
void |
updateCurrentDate()
Force an update of the currently shown programs in the program table
where we need to add/update a TV rating.
|
protected void |
updateRootNode()
collect all expired favorites without rating for the plugin tree
|
void |
writeData(ObjectOutputStream out)
Counterpart to loadData.
|
canReceivePrograms, canReceiveProgramsWithTarget, createImageIcon, createImageIcon, createImageIcon, createImageIconForFileName, execute, execute, execute, getButtonIconName, getButtonText, getContextMenuItemText, getId, getJarFile, getMarkIcon, getMarkIconFromTheme, getMarkIcons, getMarkIconsForProgram, getMarkPriorityForProgram, getParentFrame, getPluginManager, getProgramFromContextMenuActionEvent, getProgramReceiveTargets, handleTvDataAdded, handleTvDataAdded, handleTvDataChanged, handleTvDataChanged, handleTvDataDeleted, handleTvDataTouched, isAllowedToDeleteProgramFilter, layoutWindow, layoutWindow, onDeactivation, receivePrograms, receivePrograms, receiveValues, saveMe, setJarFile, setParent, setPluginManager, storeRootNode, supportMultipleProgramExecution, toString
protected static final int MINLENGTH
public static Version getVersion()
public PluginInfo getInfo()
Plugin
Override this method to provide information about your plugin.
public ActionMenu getButtonAction()
Plugin
Override this method to provide a menu item in the main menu and a toolbar button.
The following action values will be used:
Action.NAME
: The text for the main menu item and the
toolbar button.Action.SHORT_DESCRIPTION
: The description for the button
action. Used as tooltip and for the status bar.Action.SMALL_ICON
: The icon for the main menu item. Should
be 16x16.BIG_ICON
: The icon for the toolbar button. Should be
24x24.getButtonAction
in class Plugin
null
if the plugin does not provide this feature.public void showDialog()
public ActionMenu getContextMenuActions(Program program)
Plugin
Override this method to provide context menu items for programs (e.g. in
the program table). If your plugin shows a context menu only for some
programs, but not for all, then you should explicitly return a non-null
menu for the example program. Otherwise your context menu will not be shown
in the settings dialog for the context menu order.
The following action values will be used:
Action.NAME
: The text for the context menu item.Action.SMALL_ICON
: The icon for the context menu item.
Should be 16x16.getContextMenuActions
in interface ContextMenuIf
getContextMenuActions
in class Plugin
program
- The program the context menu will be shown for.null
if the plugin does not provide this feature.Plugin.getProgramFromContextMenuActionEvent(ActionEvent)
public void showRatingDialog(Program program)
public Properties storeSettings()
Plugin
Override this method to store your plugins settings to the file system. ATTENTION: Don't use any logger, thread or access to Frames in this method.
storeSettings
in class Plugin
null
if this plugin
does not need to save any settings.public void loadSettings(Properties settings)
Plugin
Override this method to load your plugins settings from the file system.
loadSettings
in class Plugin
settings
- The settings for this plugin (May be empty).public SettingsTab getSettingsTab()
Plugin
Override this method to provide a settings tab. The settings tab will be shown in the settings dialog in the plugin section.
getSettingsTab
in class Plugin
null
if the plugin does not
provide this feature.public String getMarkIconName()
Plugin
This icon is used for marking programs in the program table.
Override this method if your plugin is able to mark programs
As an alternative you can use an Icon from the Icon-Theme using Plugin.getMarkIconFromTheme()
getMarkIconName
in class Plugin
null
if the plugin does not provide this feature.Plugin.getMarkIcon()
,
Program.mark(Plugin)
,
Program.unmark(Plugin)
public String getProgramTableIconText()
Return null
if your plugin does not provide this feature.
getProgramTableIconText
in class Plugin
getProgramTableIcons(Program)
public Icon[] getProgramTableIcons(Program program)
Return null
if your plugin does not provide this feature.
getProgramTableIcons
in class Plugin
program
- The programs to get the icons for.null
.getProgramTableIconText()
public Rating getRating(Program program)
program
- Get rating for this programpublic Database getDatabase()
public Properties getSettings()
public void readData(ObjectInputStream in) throws IOException, ClassNotFoundException
readData
in class Plugin
in
- The stream to read the objects from.IOException
- If reading failed.ClassNotFoundException
- If an object could not be casted correctly.writeData(ObjectOutputStream)
public void writeData(ObjectOutputStream out) throws IOException
writeData
in class Plugin
out
- The stream to write the objects toIOException
- If writing failed.readData(ObjectInputStream)
public Frame getParentFrameForTVRater()
The parent frame may be used for showing dialogs.
public void handleTvBrowserStartFinished()
Plugin
handleTvBrowserStartFinished
in class Plugin
public void handleTvDataUpdateFinished()
Plugin
Override this method to react on this event. If you want to read data from the internet use this method to track if a connection was established. ATTENTION: If you do so take care of the TV-Browser start, at the start this method mustn't use an internet connection. Use the method handleTvBrowserStartFinished() to track if the TV-Browser start was finished before allowing access to the internet in this method.
public static TVRaterPlugin getInstance()
public boolean isProgramRateable(Program program)
program
- Program to checkpublic Class<? extends PluginsFilterComponent>[] getAvailableFilterComponentClasses()
Plugin
(Class extends PluginsFilterComponent>[]) new Class[] {MyFilterComponent1.class,MyFilterComponent2.class};
because the creation of a class array with generic type didn't work.getAvailableFilterComponentClasses
in class Plugin
null
if no plugins filter components are supported.public PluginsProgramFilter[] getAvailableFilter()
Plugin
getAvailableFilter
in class Plugin
null
if it supports no filter.public void updateCurrentDate()
public boolean canUseProgramTree()
Plugin
canUseProgramTree
in class Plugin
Plugin.getRootNode()
public PluginTreeNode getRootNode()
Plugin
getRootNode
in class Plugin
Plugin.canUseProgramTree()
protected void updateRootNode()
public void onActivation()
Plugin
onActivation
in class Plugin
public ProgramRatingIf[] getRatingInterfaces()
Plugin
PluginManager.getAllProgramRatingIfs()
The plugin can return more than one ratingif, e.g. average ratings, user rating ...getRatingInterfaces
in class Plugin
TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)