Module jEdit

Class FavoritesVFS

java.lang.Object
org.gjt.sp.jedit.io.VFS
org.gjt.sp.jedit.io.FavoritesVFS

public class FavoritesVFS extends VFS
A VFS used for remembering frequently-visited directories. Listing it returns the favorites list. The deletePath of each entry is the directory prefixed with "favorites:" so that right-clicking on a favorite and clicking 'delete' in the browser just deletes the favorite, and not the directory itself.
Version:
$Id: FavoritesVFS.java 25331 2020-05-09 14:24:20Z kpouer $
Author:
Slava Pestov
  • Field Details

  • Constructor Details

    • FavoritesVFS

      public FavoritesVFS()
  • Method Details

    • getParentOfPath

      @Nonnull public String getParentOfPath(String path)
      Description copied from class: VFS
      Returns the parent of the specified path. This must be overridden to return a non-null value for browsing of this filesystem to work.
      Overrides:
      getParentOfPath in class VFS
      Parameters:
      path - The path
    • _listFiles

      public VFSFile[] _listFiles(Object session, String url, Component comp)
      Description copied from class: VFS
      Lists the specified directory.
      Overrides:
      _listFiles in class VFS
      Parameters:
      session - The session
      url - The directory. Note that this must be a full URL, including the host name, path name, and so on. The username and password (if needed by the VFS) is obtained from the session instance.
      comp - The component that will parent error dialog boxes
    • _getFile

      public VFSFile _getFile(Object session, String path, Component comp)
      Description copied from class: VFS
      Returns the specified directory entry.
      Overrides:
      _getFile in class VFS
      Parameters:
      session - The session get it with VFS.createVFSSession(String, Component)
      path - The path
      comp - The component that will parent error dialog boxes
      Returns:
      The specified directory entry, or null if it doesn't exist.
    • _delete

      public boolean _delete(Object session, String path, Component comp)
      Description copied from class: VFS
      Deletes the specified URL.
      Overrides:
      _delete in class VFS
      Parameters:
      session - The VFS session
      path - The path
      comp - The component that will parent error dialog boxes
    • _rename

      public boolean _rename(Object session, String from, String to, Component comp)
      Rename a favorite
      Overrides:
      _rename in class VFS
      Parameters:
      session - no session needed you can give null
      from - The old path (not the name)
      to - the new name
      comp - The component that will parent error dialog boxes
      Returns:
      true if the favorite having that old path exists
    • loadFavorites

      public static void loadFavorites()
    • addToFavorites

      public static void addToFavorites(String path, int type)
    • saveFavorites

      public static void saveFavorites()
    • getFavorites

      public static VFSFile[] getFavorites()