public class TVRaterPlugin extends Plugin
Modifier and Type | Field and Description |
---|---|
static int |
MINLENGTH |
Constructor and Description |
---|
TVRaterPlugin() |
Modifier and Type | Method and Description |
---|---|
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.
|
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 |
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 |
writeData(ObjectOutputStream out)
Counterpart to loadData.
|
canReceivePrograms, canUseProgramTree, createImageIcon, createImageIcon, createImageIcon, execute, execute, execute, getButtonIconName, getButtonText, getContextMenuItemText, getId, getJarFile, getMarkIcon, getMarkIconFromTheme, getParentFrame, getPluginManager, getProgramFromContextMenuActionEvent, getRootNode, handleTvDataAdded, handleTvDataChanged, handleTvDataChanged, handleTvDataDeleted, onActivation, onDeactivation, receivePrograms, setJarFile, setParent, setPluginManager, storeRootNode, supportMultipleProgramExecution, toString
public 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).
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 seetings 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 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 checkTV-Browser 2.2.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)