com.sun.javatest.tool
Class FileHistory.Listener

java.lang.Object
  extended by com.sun.javatest.tool.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
FileHistory.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.
FileHistory.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.
FileHistory.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.
 
Method Summary
 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

FileHistory.Listener

public FileHistory.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.

FileHistory.Listener

public FileHistory.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.

FileHistory.Listener

public FileHistory.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

getFileHistory

public FileHistory getFileHistory()
Get the FileHistory object from which to obtain the dynamic menu entries.

Returns:
the FileHistory object from which to obtain the dynamic menu entries
See Also:
setFileHistory(com.sun.javatest.tool.FileHistory)

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


Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.