Class FileHistory


  • public class FileHistory
    extends java.lang.Object
    A kind of wrapper for the file history (menu) functionality.
    Version:
    1.0
    Author:
    Andreas
    • Constructor Summary

      Constructors 
      Constructor Description
      FileHistory​(Client parent, java.util.Properties settings, javax.swing.JMenu menu, int index)
      Creates new FileHistory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFileToHistory​(java.io.File f)
      Adds a single file to the file history, as well to the file history bucket as well to the file history menu.
      void buildFileHistoryMenu()
      Inserts the contents of the fileHistory bucket to the file history menu (it assumes that the menu has been cleared previously.
      void clearFileHistoryMenu()
      Uses the current contents of the file history bucket to remove these menu items from the file history menu.
      java.io.File getLastExistingReport()
      Returns the last file loaded into Magellan.
      int getMaxFileHistorySize()
      Returns the maximum number of entries in the history of loaded files.
      void loadFile​(java.io.File file)
      Loads the the given file.
      void setMaxFileHistorySize​(int size)
      Allows to set the maximum number of files appearing in the file history.
      void storeFileHistory()
      Stores the current contents of the file history bucket to the settings.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • historyMenu

        protected javax.swing.JMenu historyMenu
      • insertionIndex

        protected int insertionIndex
      • settings

        protected java.util.Properties settings
      • client

        protected Client client
    • Constructor Detail

      • FileHistory

        public FileHistory​(Client parent,
                           java.util.Properties settings,
                           javax.swing.JMenu menu,
                           int index)
        Creates new FileHistory
    • Method Detail

      • addFileToHistory

        public void addFileToHistory​(java.io.File f)
        Adds a single file to the file history, as well to the file history bucket as well to the file history menu.
      • storeFileHistory

        public void storeFileHistory()
        Stores the current contents of the file history bucket to the settings.
      • getLastExistingReport

        public java.io.File getLastExistingReport()
        Returns the last file loaded into Magellan.
      • clearFileHistoryMenu

        public void clearFileHistoryMenu()
        Uses the current contents of the file history bucket to remove these menu items from the file history menu.
      • buildFileHistoryMenu

        public void buildFileHistoryMenu()
        Inserts the contents of the fileHistory bucket to the file history menu (it assumes that the menu has been cleared previously.
      • getMaxFileHistorySize

        public int getMaxFileHistorySize()
        Returns the maximum number of entries in the history of loaded files.
      • setMaxFileHistorySize

        public void setMaxFileHistorySize​(int size)
        Allows to set the maximum number of files appearing in the file history.
      • loadFile

        public void loadFile​(java.io.File file)
        Loads the the given file. This method should only be called by FileHistoryAction objects.