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.
|
dispose, getContext, registerEventHandlers, setContext, toString
compareTo, getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
registerEventHandlers
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
dispose
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 Service
initialize
in class AbstractService
protected void onEvent(IOEvent event)
Copyright © 2009–2015 SciJava. All rights reserved.