shutdown tasks

Developers
Belen
2007-05-19
2012-09-03
  • Belen
    Belen
    2007-05-19

    Hi, I want to implement a funcionality to creaete shutdown tasks. I have to modify the "Appointment editor" to add the option to shutdown and the code to implement the shutdown intself.

    Could you tell me witch *.class do I have to modify? Thanks

     
    • Belen
      Belen
      2007-05-20

      Thank you for the info.

      I've been reading the code of PopupView and I have found the variable Prefs. What it is exactly?
      I'm new in Java, is it a global variable? I've only found its class, but not where this is implemented into object.

      Thanks...

       
    • Belen
      Belen
      2007-05-19

      sorry, I wanted to say *.java

       
    • Mike Berger
      Mike Berger
      2007-05-19

      The appointment editor code is in net.sf.borg.ui.AppointmentPanel.java
      To shutdown the program call Borg.shutdown();

      In order to mark an appointment as a shutdown appointment, you need to store a shutdown flag in the appointment.
      If this code is just for a class assignment, then it is easiest to reuse an existing field in the Appointment class because adding a new field to the database requires a lot more changes. The field "Alarm" is only used for syncing BORG with a Palm Pilot. If you do not need to sync BORG with a Palm Pilot, you can use the Alarm field to indicate a shutdown appointment and just change the label in the Appointment editor from Alarm to Shutdown.

      It is up to you as to where to put the code to check if we have to shutdown. You might want to look at net.sf.borg.ui.PopupView.java which has code that uses a Timer to check if we need to popup reminder windows.

      Mike

       
    • Mike Berger
      Mike Berger
      2007-05-21

      net.sf.borg.common.util.Prefs.java is in the BORGCalendarCommon Project. It is the class that BORG uses to manage user preferences. It calls the Java Preferences class.

      net.sf.borg.common.util.PrefName.java is where all of the allowed preferences are defined along with their initial values.

      BORG is split into 5 Eclipse projects. Eclipse is used to enforce the proper dependencies between the parts of BORG. For example, BORGCalendarCommon code is a common library and cannot reference code in the 4 other projects. BORGCalendarModel cannot reference UI code. etc.... That is why all of the java code is not under a single src folder.