public class RecentDocuments extends Object implements RecentDocumentsFactory
| Modifier and Type | Field and Description |
|---|---|
int |
noOfRecentDocs |
JMenuItem[] |
recentDocuments |
| Constructor and Description |
|---|
RecentDocuments(int noOfRecentDocs) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToFileList(String selectedFile)
Adds a file to the list of recent file
|
void |
clearRecentDocuments(PropertiesFile properties)
Remove all items from the recent documents list and stored in properties list
|
void |
createMenuItems(String fileNameToAdd,
int position,
GUIFactory currentGUI,
Values commonValues)
Create the menu items used to represent the recent documents in the Viewer menu
|
void |
enableRecentDocuments(boolean enable)
Control if recent documents items should be enabled and visible
|
String |
getNextDocument()
Get the file name of the next document in the list.
|
String |
getPreviousDocument()
Get the previously opened documents file name
|
void |
updateRecentDocuments(String[] recentDocs)
Set the recent documents items from the set of values provided
|
public final int noOfRecentDocs
public final JMenuItem[] recentDocuments
public String getPreviousDocument()
getPreviousDocument in interface RecentDocumentsFactorypublic String getNextDocument()
getNextDocument in interface RecentDocumentsFactorypublic void addToFileList(String selectedFile)
addToFileList in interface RecentDocumentsFactoryselectedFile - String representing a file namepublic void enableRecentDocuments(boolean enable)
enableRecentDocuments in interface RecentDocumentsFactoryenable - True to show and enable the recent documents items, false otherwisepublic void updateRecentDocuments(String[] recentDocs)
updateRecentDocuments in interface RecentDocumentsFactoryrecentDocs - String array of file names to load into the recent documentspublic void clearRecentDocuments(PropertiesFile properties)
clearRecentDocuments in interface RecentDocumentsFactoryproperties - PropertiesFile object holding the recent documents to clearpublic void createMenuItems(String fileNameToAdd, int position, GUIFactory currentGUI, Values commonValues)
createMenuItems in interface RecentDocumentsFactoryfileNameToAdd - String filename for the menu itemposition - int value representing the position in the recent documentscurrentGUI - GUIFactory object to add the menu item tocommonValues - Values object used by the viewCopyright © 2017. All rights reserved.