Package adams.core

Class AbstractFileBasedHistory<T extends File>

    • Field Detail

      • m_MinNumParentDirs

        protected int m_MinNumParentDirs
        the minimum number of parent directories to use.
    • Constructor Detail

      • AbstractFileBasedHistory

        public AbstractFileBasedHistory()
    • Method Detail

      • newInstance

        protected abstract T newInstance​(String path)
        Creates a new file object from the string.
        Parameters:
        path - the path to create the object from
      • copy

        protected T copy​(T obj)
        Creates a copy of the object.
        Specified by:
        copy in class AbstractHistory<T extends File>
        Parameters:
        obj - the object to copy
      • load

        protected boolean load()
        Loads the history from disk.
        Specified by:
        load in class AbstractPersistentHistory<T extends File>
        Returns:
        true if successfully loaded
      • determineMinimumNumberOfParentDirs

        protected int determineMinimumNumberOfParentDirs()
        Determines the minimum number of parent directories that need to be included in the filename to make the filenames in the menu distinguishable.
        Returns:
        the minimum number of parent directories, -1 means full path
      • generateMenuItemCaption

        protected String generateMenuItemCaption​(T obj)
        Generates an HTML caption for the an entry in the history menu.
        Parameters:
        obj - the object to create the caption for
        Returns:
        the generated HTML captiopn
      • customizePopupMenu

        public void customizePopupMenu​(JPopupMenu menu,
                                       Object current,
                                       HistorySelectionListener listener)
        Adds a menu item with the history to the popup menu.
        Parameters:
        menu - the menu to add the history to
        current - the current object
        listener - the listener to attach to the menu items' ActionListener