|
||||||||||
| 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. |
| Field Summary | |
|---|---|
protected JMenu |
_fileMenu
The File menu containing the entries. |
protected int |
_initPos
Position in the file menu where the entries start. |
protected HashSet<JMenu> |
_mirroredMenus
Other File menus to be kept synchronized to the original File menu. |
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 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 | |
|---|---|
void |
_do(Runnable1<JMenu> r)
Apply the passed runnable to all menus, i.e. |
void |
_insertSeparator(int pos)
Insert a separator into all menus at the specified position. |
void |
_remove(int pos)
Remove a menu item from all menus at the specified position. |
void |
addMirroredMenu(JMenu mirroredMenu)
Add another menu that should be kept identical to the main File menu. |
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 |
removeMirroredMenu(JMenu mirroredMenu)
Remove a menu that was kept identical to the main File menu. |
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 _initPos
protected int _pos
protected Vector<File> _recentFiles
protected int MAX
protected JMenu _fileMenu
protected HashSet<JMenu> _mirroredMenus
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 to| Method Detail |
|---|
public void addMirroredMenu(JMenu mirroredMenu)
mirroredMenu - menu to keep identicalpublic void removeMirroredMenu(JMenu mirroredMenu)
mirroredMenu - menu to removepublic 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()
public void _do(Runnable1<JMenu> r)
r - Runnable to apply to all menus.public void _insertSeparator(int pos)
pos - position for the separator.public void _remove(int pos)
pos - position from which the menu item should be removed .
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||