|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.drjava.ui.RecentFileManager
public class RecentFileManager
Manages a list of the most recently used files to be displayed in the File menu.
Nested Class Summary | |
---|---|
static interface |
RecentFileManager.RecentFileAction
This interface is to be implemented and passed to the manager upon creation. |
Nested classes/interfaces inherited from interface edu.rice.cs.drjava.config.OptionConstants |
---|
OptionConstants.AccessLevelChoices, OptionConstants.DefaultFont, OptionConstants.HeapSizeChoices, OptionConstants.LookAndFeels, OptionConstants.PlasticThemes, OptionConstants.VersionNotificationChoices |
Field Summary | |
---|---|
protected JMenu |
_fileMenu
The File menu containing the entries. |
protected int |
_pos
Position in the file menu for the next insert. |
protected RecentFileManager.RecentFileAction |
_recentFileAction
An action that will be invoked when the file is clicked. |
protected Vector<File> |
_recentFiles
All of the recently used files in the list, in order. |
protected Vector<JMenuItem> |
_recentMenuItems
Menu items corresponding to each file in _recentFiles. |
protected VectorOption<File> |
_settingConfigConstant
The OptionConstant that should be used to retrieve the list of recent files. |
protected int |
MAX
The maximum number of files to display in the list. |
Constructor Summary | |
---|---|
RecentFileManager(int pos,
JMenu fileMenu,
RecentFileManager.RecentFileAction action,
VectorOption<File> settingConfigConstant)
Creates a new RecentFileManager. |
Method Summary | |
---|---|
Vector<File> |
getFileVector()
Returns the list of recently used files, in order. |
void |
numberItems()
Trims the recent file list to the configured size and numbers the remaining files according to their position in the list |
void |
removeIfInList(File file)
Removes the given file from the list if it is already there. |
void |
saveRecentFiles()
Saves the current list of files to the config object. |
void |
updateMax(int newMax)
Changes the maximum number of files to display in the list. |
void |
updateOpenFiles(File file)
Updates the list after the given file has been opened. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int _pos
protected Vector<File> _recentFiles
protected Vector<JMenuItem> _recentMenuItems
protected int MAX
protected JMenu _fileMenu
protected VectorOption<File> _settingConfigConstant
protected RecentFileManager.RecentFileAction _recentFileAction
Constructor Detail |
---|
public RecentFileManager(int pos, JMenu fileMenu, RecentFileManager.RecentFileAction action, VectorOption<File> settingConfigConstant)
pos
- Position in the file menufileMenu
- File menu to add the entry toMethod Detail |
---|
public Vector<File> getFileVector()
public void updateMax(int newMax)
newMax
- The new maximum number of files to displaypublic void saveRecentFiles()
public void updateOpenFiles(File file)
public void removeIfInList(File file)
public void numberItems()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |