org.bs.mdi
Class RecentFiles

java.lang.Object
  extended byorg.bs.mdi.RecentFiles

public class RecentFiles
extends Object

Remembers recently opened filenames.


Constructor Summary
RecentFiles()
          Creates a new RecentFiles object.
 
Method Summary
 void add(String filename)
          Adds the given filename to the list of remembered filenames.
 int count()
          Returns the number of items which are currently saved in the list of recently opened filenames.
protected  void expire()
           
protected  org.bs.mdi.RecentFiles.RecentFileEntry findEntry(String filename)
           
 long getExpiryTime()
          Returns the expiry time of all entries, in milliseconds.
 String[] getList()
          Returns the list of recently opened filenames.
 int getMaxEntries()
          Returns the maximum number of filenames returned by getList().
protected  void load()
           
 void remove(String filename)
          Removes the given filename from the list of recently opened filenames.
protected  void save()
           
 void setExpiryTime(long time)
          Sets the "time to live" of an recent filename entry.
 void setMaxEntries(int maxEntries)
          Sets the maximum number of filenames returned by getList().
protected  void sort()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecentFiles

public RecentFiles()
Creates a new RecentFiles object.

Method Detail

add

public void add(String filename)
Adds the given filename to the list of remembered filenames.

Parameters:
filename - the filename to be remembered

getList

public String[] getList()
Returns the list of recently opened filenames.

Returns:
the list of recent filenames

count

public int count()
Returns the number of items which are currently saved in the list of recently opened filenames.

Returns:
the number of filenames

remove

public void remove(String filename)
Removes the given filename from the list of recently opened filenames.

Parameters:
filename - the filename to be removed

getExpiryTime

public long getExpiryTime()
Returns the expiry time of all entries, in milliseconds. If a filename has not been re-opened during its expiry time, it is automatically removed from the list of remembered filenames.

Returns:
the expiry time

setExpiryTime

public void setExpiryTime(long time)
Sets the "time to live" of an recent filename entry. If a filename has not been re-opened during its expiry time, it is automatically removed from the list of remembered filenames.

Parameters:
time - the expiry time in milliseconds

getMaxEntries

public int getMaxEntries()
Returns the maximum number of filenames returned by getList().

Returns:
the maximum number of filenames returned by getList().

setMaxEntries

public void setMaxEntries(int maxEntries)
Sets the maximum number of filenames returned by getList().

Parameters:
maxEntries - the new maximum number of filenames

sort

protected void sort()

load

protected void load()

save

protected void save()

expire

protected void expire()

findEntry

protected org.bs.mdi.RecentFiles.RecentFileEntry findEntry(String filename)