Class StartupShutdownSongManager

java.lang.Object
org.netbeans.spi.sendopts.OptionProcessor
org.jjazz.songeditormanager.api.StartupShutdownSongManager
All Implemented Interfaces:
Callable<Boolean>

public class StartupShutdownSongManager extends org.netbeans.spi.sendopts.OptionProcessor implements Callable<Boolean>
Manage the opening/closing of song files at startup/shutdown.

Upon startup, if file names arguments are passed on the command line, open these files. Otherwise restore the last opened files depending on setting. Upon shutdown ask for user confirmation for unsaved songs.

  • Constructor Details

    • StartupShutdownSongManager

      public StartupShutdownSongManager()
      Reserved do not use : use getInstance() instead.
  • Method Details

    • getInstance

      public static final StartupShutdownSongManager getInstance()
    • setOpenRecentFilesUponStartup

      public void setOpenRecentFilesUponStartup(boolean b)
    • isOpenRecentFilesUponStartup

      public final boolean isOpenRecentFilesUponStartup()
    • call

      public Boolean call() throws Exception
      Called upon shutdown.

      Ask user confirmation if unsaved changes (whatever nb of unsaved files), close properly the opened songs (so that listeners with persistence like RecentFiles are notified).

      Also save the opened songs for possible reopen at startup (see isOpenRecentFilesUponStartup()).

      Specified by:
      call in interface Callable<Boolean>
      Throws:
      Exception