|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.utils.RecentFileManager
RecentFileManager - manage a set of "recent files" including the AWT menu stuff, AWT event and callback handling, and storage to a file or URL. The API for this class is based on the RecentFileList class from the org.freehep.swing package by Tony Johnson (tonyj@slac.stanford.edu).
Field Summary | |
(package private) java.lang.String[] |
filenames
|
int |
MAXCHARS
|
(package private) java.awt.MenuItem[] |
menuItems
|
(package private) java.awt.event.ActionListener |
target
|
Constructor Summary | |
RecentFileManager()
|
|
RecentFileManager(int n)
|
Method Summary | |
void |
add(java.io.File file)
retrieve the pathname of "file" and forward to the add( name ) method |
void |
add(java.lang.String name)
add a file or URL "name" to our entries, and re-sort them: we just put the entry at position 0, and then walk through the filenames array. |
java.awt.MenuItem[] |
createMenuItems(java.awt.event.ActionListener listener)
create n_entries menu items in the given Menu. |
java.lang.String |
get(java.awt.event.ActionEvent evt)
|
java.lang.String |
get(int i)
|
java.lang.String |
get(java.lang.String name)
|
java.lang.String |
getMenuItemLabel(int i)
|
int |
getSize()
|
void |
load(java.util.Properties props)
load the recent filenames from a Properties object, using "RecentFile0", "RecentFile1", etc. |
void |
loadFromFile(java.lang.String filename)
|
static void |
main(java.lang.String[] argv)
minimal selftest |
void |
print()
|
void |
save(java.util.Properties props)
save the current filename entries as a Properties object, using "RecentFile0", "RecentFile1", etc. |
void |
saveToFile(java.lang.String filename)
|
void |
setActionListener(java.awt.event.ActionListener al)
|
void |
updateMenuItems()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final int MAXCHARS
java.lang.String[] filenames
java.awt.MenuItem[] menuItems
java.awt.event.ActionListener target
Constructor Detail |
public RecentFileManager()
public RecentFileManager(int n)
Method Detail |
public int getSize()
public void setActionListener(java.awt.event.ActionListener al)
public void add(java.io.File file)
public void add(java.lang.String name)
public void print()
public java.lang.String get(java.lang.String name)
public java.lang.String get(int i)
public java.awt.MenuItem[] createMenuItems(java.awt.event.ActionListener listener)
public void updateMenuItems()
public java.lang.String getMenuItemLabel(int i)
public java.lang.String get(java.awt.event.ActionEvent evt)
public void save(java.util.Properties props)
public void load(java.util.Properties props)
public void saveToFile(java.lang.String filename)
public void loadFromFile(java.lang.String filename)
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |