org.scijava.io
Class DefaultRecentFileService

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.service.AbstractService
              extended by org.scijava.io.DefaultRecentFileService
All Implemented Interfaces:
Comparable<Prioritized>, Contextual, Disposable, RecentFileService, HasPluginInfo, RichPlugin, SciJavaPlugin, Prioritized, SciJavaService, Service

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
DefaultRecentFileService()
           
 
Method Summary
 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.
 
Methods inherited from class org.scijava.service.AbstractService
dispose, getContext, registerEventHandlers, setContext, toString
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, 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.service.Service
registerEventHandlers
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Disposable
dispose
 

Constructor Detail

DefaultRecentFileService

public DefaultRecentFileService()
Method Detail

add

public void add(String path)
Description copied from interface: RecentFileService
Adds or refreshes a path on the list of recent files.

Specified by:
add in interface RecentFileService

remove

public boolean remove(String path)
Description copied from interface: RecentFileService
Removes a path from the list of recent files.

Specified by:
remove in interface RecentFileService

clear

public void clear()
Description copied from interface: RecentFileService
Clears the list of recent files.

Specified by:
clear in interface RecentFileService

getRecentFiles

public List<String> getRecentFiles()
Description copied from interface: RecentFileService
Gets the list of recent files.

Specified by:
getRecentFiles in interface RecentFileService

initialize

public void initialize()
Description copied from interface: Service
Performs 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:
initialize in interface Service
Overrides:
initialize in class AbstractService

onEvent

protected void onEvent(IOEvent event)


Copyright © 2009–2015 SciJava. All rights reserved.