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.
|
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, setInfogetLocationgetVersiondisposepublic 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 Serviceprotected void onEvent(IOEvent event)
Copyright © 2009–2018 SciJava. All rights reserved.