public final class DefaultRecentFileService extends AbstractService implements RecentFileService
Behavior: There is a limited number of files presented (maxFilesShown), regardless of the list length. When a file is opened, its path is added to the top of the list. If data has been saved as a new file, its path is added to the top of the list.
MAX_FILES_SHOWN| Constructor and Description | 
|---|
DefaultRecentFileService()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
add(String path)
Adds or refreshes a path on the list of recent files. 
 | 
void | 
clear()
Clears the list of recent files. 
 | 
void | 
dispose()
Performs any needed cleanup of the object's services, in preparation for
 the object being retired (e.g., to make garbage collection possible). 
 | 
List<String> | 
getRecentFiles()
Gets the list of recent files. 
 | 
void | 
initialize()
Performs any needed initialization when the service is first loaded. 
 | 
protected void | 
onEvent(IOEvent event)  | 
boolean | 
remove(String path)
Removes a path from the list of recent files. 
 | 
getContext, setContext, toStringgetInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitregisterEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersionpublic void add(String path)
RecentFileServiceadd in interface RecentFileServicepublic boolean remove(String path)
RecentFileServiceremove in interface RecentFileServicepublic void clear()
RecentFileServiceclear in interface RecentFileServicepublic List<String> getRecentFiles()
RecentFileServicegetRecentFiles in interface RecentFileServicepublic void initialize()
Service
 NB: This method is not intended to be called directly. It is called by
 the service framework itself (specifically by the ServiceHelper)
 when initializing the service. It should not be called a second time.
 
initialize in interface Initializableinitialize in interface Servicepublic void dispose()
Disposabledispose in interface Disposableprotected void onEvent(IOEvent event)
Copyright © 2015–2022 SciJava. All rights reserved.