Package org.scijava.io
Class DefaultRecentFileService
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.service.AbstractService
-
- org.scijava.io.DefaultRecentFileService
-
- All Implemented Interfaces:
Comparable<Prioritized>,Contextual,Disposable,Identifiable,Initializable,RecentFileService,Locatable,Logged,HasPluginInfo,RichPlugin,SciJavaPlugin,Prioritized,SciJavaService,Service,Versioned
public final class DefaultRecentFileService extends AbstractService implements RecentFileService
Default service for managing the Recently Used Files menu.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.
- Author:
- Grant Harris, Curtis Rueden
-
-
Field Summary
-
Fields inherited from interface org.scijava.io.RecentFileService
MAX_FILES_SHOWN
-
-
Constructor Summary
Constructors Constructor Description DefaultRecentFileService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String path)Adds or refreshes a path on the list of recent files.voidclear()Clears the list of recent files.voiddispose()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.voidinitialize()Performs any needed initialization when the service is first loaded.protected voidonEvent(IOEvent event)booleanremove(String path)Removes a path from the list of recent files.-
Methods inherited from class org.scijava.service.AbstractService
getContext, setContext, toString
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority
-
Methods inherited from class org.scijava.AbstractContextual
context
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
add
public void add(String path)
Description copied from interface:RecentFileServiceAdds or refreshes a path on the list of recent files.- Specified by:
addin interfaceRecentFileService
-
remove
public boolean remove(String path)
Description copied from interface:RecentFileServiceRemoves a path from the list of recent files.- Specified by:
removein interfaceRecentFileService
-
clear
public void clear()
Description copied from interface:RecentFileServiceClears the list of recent files.- Specified by:
clearin interfaceRecentFileService
-
getRecentFiles
public List<String> getRecentFiles()
Description copied from interface:RecentFileServiceGets the list of recent files.- Specified by:
getRecentFilesin interfaceRecentFileService
-
initialize
public void initialize()
Description copied from interface:ServicePerforms any needed initialization when the service is first loaded.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.- Specified by:
initializein interfaceInitializable- Specified by:
initializein interfaceService
-
dispose
public void dispose()
Description copied from interface:DisposablePerforms any needed cleanup of the object's services, in preparation for the object being retired (e.g., to make garbage collection possible).- Specified by:
disposein interfaceDisposable
-
onEvent
protected void onEvent(IOEvent event)
-
-