com.darwinsys.util
Class RecentItems

java.lang.Object
  extended by com.darwinsys.util.RecentItems

public class RecentItems
extends java.lang.Object

A list of recent items, such as a Recent File Menu, a Recent Choices dropdown, etc.


Nested Class Summary
static interface RecentItems.Callback
           
 
Field Summary
static int DEFAULT_MAX_RECENT_FILES
           
 
Constructor Summary
RecentItems(java.util.prefs.Preferences prefs, RecentItems.Callback cb)
           
RecentItems(java.util.prefs.Preferences prefs, RecentItems.Callback cb, int max)
           
 
Method Summary
 void clear()
          Clear all saved Recent Items from Preferences, from memory, and from the Menu.
 java.util.List<java.lang.String> getList()
           
 void putRecent(java.lang.String f)
          Add the given filename to the top of the recent list in Prefs and in menu.
 void remove(java.lang.String f)
          Remove the given name from the list; does NOT invoke your callback since it might have been invoked in your callback...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_RECENT_FILES

public static final int DEFAULT_MAX_RECENT_FILES
See Also:
Constant Field Values
Constructor Detail

RecentItems

public RecentItems(java.util.prefs.Preferences prefs,
                   RecentItems.Callback cb,
                   int max)

RecentItems

public RecentItems(java.util.prefs.Preferences prefs,
                   RecentItems.Callback cb)
Method Detail

putRecent

public void putRecent(java.lang.String f)
Add the given filename to the top of the recent list in Prefs and in menu. It is generally not necessary for user code to call this method!


getList

public java.util.List<java.lang.String> getList()

clear

public void clear()
Clear all saved Recent Items from Preferences, from memory, and from the Menu. There is NO UNDO for this so call with care. DOES invoke your callback.


remove

public void remove(java.lang.String f)
Remove the given name from the list; does NOT invoke your callback since it might have been invoked in your callback...



Copyright © 1996-2004 Ian F. Darwin. See license.html for usage license.