- java.lang.Object
-
- tvbrowser.extras.reminderplugin.ReminderPlugin
-
public class ReminderPlugin extends java.lang.Object
TV-Browser- Author:
- Martin Oberhauser
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static Localizer
LOCALIZER
The localizer for this class.static java.lang.String
REMINDER_LIST_ACTION_ID
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addPanel()
void
addProgram(Program prog, int reminderMinutes)
Adds a program to the reminder list.void
addPrograms(Program[] programArr)
Add the given programs to the reminder list.void
addPrograms(Program[] programArr, int reminderMinutes)
Add the given programs to the reminder list.static RemindValue[]
calculatePossibleReminders(Program program)
(package private) void
endPause()
(package private) AfterDataUpdateInfoPanel
getAfterDataUpdateInfoPanel()
protected ActionMenu
getButtonAction()
protected ProgramReceiveTarget[]
getClientPluginsTargets()
protected ActionMenu
getContextMenuActions(Program program)
protected ActionMenu
getContextMenuActions(java.awt.Window parentFrame, Program program)
int
getDefaultReminderTime()
Gets the default reminder time.(package private) ActionMenu
getDeleteMenu(Program p)
static ReminderPlugin
getInstance()
Gets the current instance of this class, or if there is no instance creates a new one.(package private) static javax.swing.KeyStroke
getKeyStrokeFrameReminders()
protected int
getMarkPriority()
(package private) static java.lang.String
getName()
PluginCenterPanelWrapper
getPluginCenterPanelWrapper()
int
getReminderMinutesForProgram(Program prog)
Gets the reminder minutes for the given program.static java.lang.String
getReminderPluginId()
get the ID of the plugin (without the need to load the plugin)static PluginTreeNode
getRootNode()
Gets the root node for the plugin tree.java.util.Properties
getSettings()
Gets the settings for the reminder.static int
getStartIndexForBeforeReminders(Program program)
protected static int
getTimeToProgramStart(Program program)
void
handleTvBrowserStartFinished()
Is been called by TVBrowser when the TV-Browser start is finished.protected void
handleTvDataUpdateFinished()
protected boolean
isAllowedToStartTimer()
Is used by the ReminderList to track if the TV-Browser start was finished.static java.lang.Object
playSound(java.lang.String fileName)
Plays a sound.int
removeProgram(Program prog)
Removes the given program from the reminder list.void
removePrograms(Program[] progArr)
Remove the given programs from the reminder list.static void
resetLocalizer()
(package private) void
saveSettings()
protected void
setClientPluginsTargets(ProgramReceiveTarget[] targets)
protected void
setMarkPriority(int priority)
void
setShowDateSeparators(boolean show)
boolean
showDateSeparators()
void
store()
Save the reminder data.java.lang.String
toString()
void
updatePrograms(Program[] programArr, int reminderMinutes, int oldMinutesValue)
Add the given programs to the reminder list.void
updateRootNode(boolean save)
Updates the plugin tree entry for this plugin.(package private) void
updateRootNode(boolean save, boolean scroll)
void
writeData(java.io.ObjectOutputStream out)
Save the data of this plugin in the given stream.
-
-
-
Field Detail
-
LOCALIZER
static Localizer LOCALIZER
The localizer for this class.
-
REMINDER_LIST_ACTION_ID
public static final java.lang.String REMINDER_LIST_ACTION_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getKeyStrokeFrameReminders
static javax.swing.KeyStroke getKeyStrokeFrameReminders()
-
endPause
void endPause()
-
getInstance
public static ReminderPlugin getInstance()
Gets the current instance of this class, or if there is no instance creates a new one.- Returns:
- The current instance of this class.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getName
static java.lang.String getName()
-
handleTvBrowserStartFinished
public void handleTvBrowserStartFinished()
Is been called by TVBrowser when the TV-Browser start is finished.
-
addPanel
void addPanel()
-
isAllowedToStartTimer
protected boolean isAllowedToStartTimer()
Is used by the ReminderList to track if the TV-Browser start was finished. (When it's finished then the Timer is allowed to start.)- Returns:
- If the Timer is allowed to start.
-
getSettings
public java.util.Properties getSettings()
Gets the settings for the reminder.- Returns:
- The settings of the reminder.
-
store
public void store()
Save the reminder data.
-
saveSettings
void saveSettings()
-
writeData
public void writeData(java.io.ObjectOutputStream out) throws java.io.IOException
Save the data of this plugin in the given stream.- Parameters:
out
- The stream to write the data in.- Throws:
java.io.IOException
- Thrown if an IO operation went wrong.
-
getContextMenuActions
protected ActionMenu getContextMenuActions(java.awt.Window parentFrame, Program program)
-
getDeleteMenu
ActionMenu getDeleteMenu(Program p)
-
getDefaultReminderTime
public int getDefaultReminderTime()
Gets the default reminder time.- Returns:
- The default reminder time in minutes.
-
addPrograms
public void addPrograms(Program[] programArr)
Add the given programs to the reminder list.- Parameters:
programArr
- The programs to add.
-
addPrograms
public void addPrograms(Program[] programArr, int reminderMinutes)
Add the given programs to the reminder list.- Parameters:
programArr
- The programs to add.reminderMinutes
- The reminder time.
-
updatePrograms
public void updatePrograms(Program[] programArr, int reminderMinutes, int oldMinutesValue)
Add the given programs to the reminder list.- Parameters:
programArr
- The programs to add.reminderMinutes
- The reminder time.oldMinutesValue
- The old reminder time.
-
removeProgram
public int removeProgram(Program prog)
Removes the given program from the reminder list.- Parameters:
prog
- The program to remove.- Returns:
- The reminder minutes of the program or ReminderFrame.DONT_REMIND_AGAIN if the program was not in the list.
-
removePrograms
public void removePrograms(Program[] progArr)
Remove the given programs from the reminder list.- Parameters:
progArr
- The programs to remove.
-
addProgram
public void addProgram(Program prog, int reminderMinutes)
Adds a program to the reminder list.- Parameters:
prog
- The program to add.reminderMinutes
- The reminder minutes for the program.
-
getReminderMinutesForProgram
public int getReminderMinutesForProgram(Program prog)
Gets the reminder minutes for the given program.- Parameters:
prog
- The program to get the reminder minutes for.- Returns:
- The reminder minutes of the program or ReminderFrame.DONT_REMIND_AGAIN if the program is not in the reminder list
- Since:
- 2.7
-
getRootNode
public static PluginTreeNode getRootNode()
Gets the root node for the plugin tree.- Returns:
- The root node for the plugin tree.
-
updateRootNode
void updateRootNode(boolean save, boolean scroll)
-
updateRootNode
public void updateRootNode(boolean save)
Updates the plugin tree entry for this plugin.- Parameters:
save
-True
if the reminder entries should be saved.
-
getButtonAction
protected ActionMenu getButtonAction()
-
playSound
public static java.lang.Object playSound(java.lang.String fileName)
Plays a sound.- Parameters:
fileName
- The file name of the sound to play.- Returns:
- The sound Object.
-
getContextMenuActions
protected ActionMenu getContextMenuActions(Program program)
-
getReminderPluginId
public static java.lang.String getReminderPluginId()
get the ID of the plugin (without the need to load the plugin)- Returns:
- the id
- Since:
- 3.0
-
getClientPluginsTargets
protected ProgramReceiveTarget[] getClientPluginsTargets()
-
setClientPluginsTargets
protected void setClientPluginsTargets(ProgramReceiveTarget[] targets)
-
getMarkPriority
protected int getMarkPriority()
-
setMarkPriority
protected void setMarkPriority(int priority)
-
getTimeToProgramStart
protected static int getTimeToProgramStart(Program program)
-
handleTvDataUpdateFinished
protected void handleTvDataUpdateFinished()
-
resetLocalizer
public static void resetLocalizer()
-
getPluginCenterPanelWrapper
public PluginCenterPanelWrapper getPluginCenterPanelWrapper()
-
getAfterDataUpdateInfoPanel
AfterDataUpdateInfoPanel getAfterDataUpdateInfoPanel()
-
showDateSeparators
public boolean showDateSeparators()
-
setShowDateSeparators
public void setShowDateSeparators(boolean show)
-
getStartIndexForBeforeReminders
public static int getStartIndexForBeforeReminders(Program program)
-
calculatePossibleReminders
public static RemindValue[] calculatePossibleReminders(Program program)
-
-