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.

      (constructor must be made public because of @ServiceProvider)

  • Method Details

    • getInstance

      public static final StartupShutdownSongManager getInstance()
    • setOpenLastFilesUponStartup

      public void setOpenLastFilesUponStartup(boolean b)
    • isOpenLastFilesUponStartup

      public boolean isOpenLastFilesUponStartup()
    • getCmdLineFilesToOpen

      public List<File> getCmdLineFilesToOpen()
      Get the files specified on the command line to be opened upon startup.
      Returns:
    • call

      public Boolean call()
      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>
    • resetRecentFileList

      public void resetRecentFileList()