Class FileHistory.Listener

  • All Implemented Interfaces:
    java.util.EventListener, javax.swing.event.MenuListener
    Enclosing class:
    FileHistory

    public static class FileHistory.Listener
    extends java.lang.Object
    implements javax.swing.event.MenuListener
    A class that will dynamically add the latest entries for a FileHistory onto a menu. To do this, an instance of this class should be added to the menu with addMenuListener.
    • Constructor Summary

      Constructors 
      Constructor Description
      Listener​(int o, java.awt.event.ActionListener l)
      Create a Listener that can be used to dynamically add the latest entries from a FileHistory onto a menu.
      Listener​(FileHistory h, int o, java.awt.event.ActionListener l)
      Create a Listener that can be used to dynamically add the latest entries from a FileHistory onto a menu.
      Listener​(java.awt.event.ActionListener l)
      Create a Listener that can be used to dynamically add the latest entries from a FileHistory onto a menu.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FileHistory getFileHistory()
      Get the FileHistory object from which to obtain the dynamic menu entries.
      void menuCanceled​(javax.swing.event.MenuEvent e)  
      void menuDeselected​(javax.swing.event.MenuEvent e)  
      void menuSelected​(javax.swing.event.MenuEvent e)  
      void setFileHistory​(FileHistory h)
      Specify the FileHistory object from which to obtain the dynamic menu entries.
      • Methods inherited from class java.lang.Object

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

      • Listener

        public Listener​(java.awt.event.ActionListener l)
        Create a Listener that can be used to dynamically add the latest entries from a FileHistory onto a menu. The dynamic entries will be added to the end of the menu when it is selected. Any previous values added by this listener will automatically be removed.
        Parameters:
        l - An ActionListener that will be notified when any of the dynamic menu entries are invoked. When this action listener is notified, the action command will be the path of the file. The corresponding File object will be registered on the source as a client property named FILE.
      • Listener

        public Listener​(int o,
                        java.awt.event.ActionListener l)
        Create a Listener that can be used to dynamically add the latest entries from a FileHistory onto a menu. Any previous values added by this listener will automatically be removed.
        Parameters:
        o - The position in the menu at which to insert the dynamic entries.
        l - An ActionListener that will be notified when any of the dynamic menu entries are invoked. When this action listener is notified, the action command will be the path of the file. The corresponding File object will be registered on the source as a client property named FILE.
      • Listener

        public Listener​(FileHistory h,
                        int o,
                        java.awt.event.ActionListener l)
        Create a Listener that can be used to dynamically add the latest entries from a FileHistory onto a menu. Any previous values added by this listener will automatically be removed.
        Parameters:
        h - The FileHistory from which to determine the entries to be added.
        o - The position in the menu at which to insert the dynamic entries.
        l - An ActionListener that will be notified when any of the dynamic menu entries are invoked. When this action listener is notified, the action command will be the path of the file. The corresponding File object will be registered on the source as a client property named FILE.
    • Method Detail

      • setFileHistory

        public void setFileHistory​(FileHistory h)
        Specify the FileHistory object from which to obtain the dynamic menu entries.
        Parameters:
        h - the FileHistory object from which to obtain the dynamic menu entries
        See Also:
        getFileHistory()
      • menuSelected

        public void menuSelected​(javax.swing.event.MenuEvent e)
        Specified by:
        menuSelected in interface javax.swing.event.MenuListener
      • menuDeselected

        public void menuDeselected​(javax.swing.event.MenuEvent e)
        Specified by:
        menuDeselected in interface javax.swing.event.MenuListener
      • menuCanceled

        public void menuCanceled​(javax.swing.event.MenuEvent e)
        Specified by:
        menuCanceled in interface javax.swing.event.MenuListener