net.sf.borg.ui.popup
Class ReminderInstance

java.lang.Object
  extended by net.sf.borg.ui.popup.ReminderInstance
Direct Known Subclasses:
ApptReminderInstance, BirthdayReminderInstance, ProjectReminderInstance, SubtaskReminderInstance, TaskReminderInstance

public abstract class ReminderInstance
extends Object

holds an instance of a reminder message. Keeps track of which reminder times have been shown for this reminder message. Is not aware of the actual UI used to display the reminder.


Constructor Summary
ReminderInstance()
           
 
Method Summary
 String calculateToGoMessage()
          calculate the to go message for a reminder instance
abstract  void do_todo(boolean delete)
          if the reminder instance is a todo, then mark it as done/complete
 int dueForPopup()
          determine if a reminder is ready to be popped up and return the number of the reminder that is ready
abstract  boolean equals(Object obj)
           
abstract  int getCurrentReminder()
          get the index of the active reminder for this instance - i.e.
 Date getInstanceTime()
          get the instance time
 char[] getRemindersShown()
           
abstract  String getText()
          get the text for the reminder
abstract  int hashCode()
           
 boolean isHidden()
           
abstract  boolean isNote()
          return true if the reminder is a note (is untimed)
abstract  boolean isTodo()
          return true if the reminder is a todo - either an appointment todo or another type of todo, such as a task
 void markAsShown(int reminderNumber)
          mark a reminder time as shown
 int minutesToGo()
           
abstract  boolean reloadAndCheckForChanges()
          reload the model entity from the db and check if it has changed.
 void setHidden(boolean hidden)
          set the hidden flag
 void setInstanceTime(Date instanceTime)
           
 void setRemindersShown(char[] remindersShown)
           
 void setShown(boolean s)
          Sets the shown flag.
abstract  boolean shouldBeShown()
          determine if an appointment popup should be shown for an appointment that doesn't yet have a popup associated with it
 boolean wasEverShown()
          get the shown flag.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReminderInstance

public ReminderInstance()
Method Detail

do_todo

public abstract void do_todo(boolean delete)
if the reminder instance is a todo, then mark it as done/complete


dueForPopup

public final int dueForPopup()
determine if a reminder is ready to be popped up and return the number of the reminder that is ready

Returns:
the reminder number or -1 if not ready for a new popup

equals

public abstract boolean equals(Object obj)
Overrides:
equals in class Object

getCurrentReminder

public abstract int getCurrentReminder()
get the index of the active reminder for this instance - i.e. latest one passed

Returns:
index of reminder or -1 if none

getInstanceTime

public final Date getInstanceTime()
get the instance time

Returns:
the instance time

getText

public abstract String getText()
get the text for the reminder

Returns:
the reminder text

hashCode

public abstract int hashCode()
Overrides:
hashCode in class Object

isHidden

public final boolean isHidden()
Returns:
true if this instance has been marked as hidden (dismissed by user)

isNote

public abstract boolean isNote()
return true if the reminder is a note (is untimed)


isTodo

public abstract boolean isTodo()
return true if the reminder is a todo - either an appointment todo or another type of todo, such as a task


markAsShown

public final void markAsShown(int reminderNumber)
mark a reminder time as shown

Parameters:
reminderNumber - the reminder time index

reloadAndCheckForChanges

public abstract boolean reloadAndCheckForChanges()
reload the model entity from the db and check if it has changed.

Returns:
true if the entity has changed in a way that affects reminders

setHidden

public final void setHidden(boolean hidden)
set the hidden flag


setShown

public final void setShown(boolean s)
Sets the shown flag.

Parameters:
s - was this popup ever shown

shouldBeShown

public abstract boolean shouldBeShown()
determine if an appointment popup should be shown for an appointment that doesn't yet have a popup associated with it

Returns:
true, if successful

wasEverShown

public final boolean wasEverShown()
get the shown flag.

Returns:
true if the popup was ever shown

setInstanceTime

public final void setInstanceTime(Date instanceTime)

setRemindersShown

public final void setRemindersShown(char[] remindersShown)

getRemindersShown

public final char[] getRemindersShown()

calculateToGoMessage

public String calculateToGoMessage()
calculate the to go message for a reminder instance

Returns:
the to go message or null if should not be shown

minutesToGo

public int minutesToGo()


Generated December 30 2011 by mbb using Apache Ant(TM) version 1.8.2 compiled on December 20 2010 and Java version 1.6.0_30 from Sun Microsystems Inc. on Linux i386 3.0.0-14-generic-pae