Esempio n. 1
0
  /**
   * complete the parts of the UI initialization that run after the splash screen has shown for a
   * while
   *
   * @param trayname name for the tray icon
   */
  private static void completeUIInitialization(String trayname) {

    // tray icon
    SunTrayIconProxy.startTrayIcon(trayname);

    // create reminder manager
    if (Prefs.getBoolPref(PrefName.REMINDERLIST)) ReminderListManager.getReference();
    else ReminderPopupManager.getReference();

    // create the main window
    MultiView mv = MultiView.getMainView();

    // load the UI modules into the main window
    mv.addModule(new MonthPanel());
    mv.addModule(new WeekPanel());
    mv.addModule(new DayPanel());
    mv.addModule(new YearPanel());
    mv.addModule(new AddrListView());
    mv.addModule(new TodoView());
    mv.addModule(new TaskModule());
    mv.addModule(new MemoPanel());
    mv.addModule(new CheckListPanel());
    mv.addModule(new SearchView());
    mv.addModule(
        new InfoView("/resource/RELEASE_NOTES.txt", Resource.getResourceString("rlsnotes")));
    mv.addModule(new InfoView("/resource/CHANGES.txt", Resource.getResourceString("viewchglog")));
    mv.addModule(new InfoView("/resource/license.htm", Resource.getResourceString("License")));

    if (Prefs.getBoolPref(PrefName.DYNAMIC_LOADING) == true) {
      addExternalModule("net.sf.borg.plugin.reports.ReportModule");
      addExternalModule("net.sf.borg.plugin.ical.IcalModule");
      addExternalModule("net.sf.borg.plugin.sync.SyncModule");
    }

    // make the main window visible
    if (!Prefs.getBoolPref(PrefName.BACKGSTART) || !SunTrayIconProxy.hasTrayIcon()) {
      mv.setVisible(true);

      // open all views that should be shown at startup
      mv.startupViews();
    }

    // destroy the splash screen
    if (splashScreen != null) {
      splashScreen.dispose();
      splashScreen = null;
    }
  }