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, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public void add(String path)
RecentFileService
add
in interface RecentFileService
public boolean remove(String path)
RecentFileService
remove
in interface RecentFileService
public void clear()
RecentFileService
clear
in interface RecentFileService
public List<String> getRecentFiles()
RecentFileService
getRecentFiles
in interface RecentFileService
public 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 Initializable
initialize
in interface Service
public void dispose()
Disposable
dispose
in interface Disposable
protected void onEvent(IOEvent event)
Copyright © 2015–2022 SciJava. All rights reserved.