corina.gui
Class OpenRecent

java.lang.Object
  |
  +--corina.gui.OpenRecent

public class OpenRecent
extends Object

A list of recently-opened files, and a factory method to generate JMenus.

To use, simply call OpenRecent.generateMenu(), and use that as you would any other JMenu. It will automatically be updated whenever the list changes due to some new file being opened. (When it's no longer strongly reachable, it'll be garbage collected.)

Version:
$Id: OpenRecent.java,v 1.3 2002/10/31 19:00:24 bitpoet Exp $
Author:
Ken Harris

Constructor Summary
OpenRecent()
           
 
Method Summary
static void fileOpened(String filename)
          Indicate to the recent-file list that a file was just opened.
static JMenu makeOpenRecentMenu()
          Generate a new recent-file menu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenRecent

public OpenRecent()
Method Detail

fileOpened

public static void fileOpened(String filename)
Indicate to the recent-file list that a file was just opened. This also updates every recent-file menu automatically.
Parameters:
filename - the (full) name of the file that was opened

makeOpenRecentMenu

public static JMenu makeOpenRecentMenu()
Generate a new recent-file menu. This menu will contain the names of (up to) the last 4 files opened. As long as the menu returned by this method is referenced, it will automatically be kept updated.