Package gaiasky.interafce
Class BookmarksManager
- java.lang.Object
-
- gaiasky.interafce.BookmarksManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BookmarksManager.BNode
-
Field Summary
Fields Modifier and Type Field Description static BookmarksManager
instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addBookmark(java.lang.String path, boolean folder)
Adds a bookmark with the given path.boolean
containsName(java.lang.String name)
boolean
containsNameRec(java.lang.String name, BookmarksManager.BNode node)
boolean
containsPath(java.lang.String path)
boolean
containsPath(java.nio.file.Path path)
static java.util.List<BookmarksManager.BNode>
getBookmarks()
java.util.List<BookmarksManager.BNode>
getBookmarksByType(java.util.List<BookmarksManager.BNode> bookmarks, java.util.List<BookmarksManager.BNode> result, boolean folder)
java.util.List<BookmarksManager.BNode>
getFolders()
java.util.List<BookmarksManager.BNode>
getLeafBookmarks()
static void
initialize()
static BookmarksManager
instance()
void
notify(Events event, java.lang.Object... data)
void
persistBookmarks()
boolean
removeBookmark(java.lang.String path)
Removes a bookmark by its path.int
removeBookmarksByName(java.lang.String name)
Remove all bookmarks with the given name.
-
-
-
Field Detail
-
instance
public static BookmarksManager instance
-
-
Method Detail
-
initialize
public static void initialize()
-
instance
public static BookmarksManager instance()
-
getBookmarks
public static java.util.List<BookmarksManager.BNode> getBookmarks()
-
getFolders
public java.util.List<BookmarksManager.BNode> getFolders()
- Returns:
- A list with all folder bookmarks
-
getLeafBookmarks
public java.util.List<BookmarksManager.BNode> getLeafBookmarks()
- Returns:
- A list with all non-folder bookmarks
-
getBookmarksByType
public java.util.List<BookmarksManager.BNode> getBookmarksByType(java.util.List<BookmarksManager.BNode> bookmarks, java.util.List<BookmarksManager.BNode> result, boolean folder)
-
containsName
public boolean containsName(java.lang.String name)
-
containsNameRec
public boolean containsNameRec(java.lang.String name, BookmarksManager.BNode node)
-
containsPath
public boolean containsPath(java.lang.String path)
-
containsPath
public boolean containsPath(java.nio.file.Path path)
-
persistBookmarks
public void persistBookmarks()
-
addBookmark
public boolean addBookmark(java.lang.String path, boolean folder)
Adds a bookmark with the given path.- Parameters:
path
- The path to add.- Returns:
- True if added.
-
removeBookmark
public boolean removeBookmark(java.lang.String path)
Removes a bookmark by its path.- Parameters:
path
- The path to remove- Returns:
- True if removed.
-
removeBookmarksByName
public int removeBookmarksByName(java.lang.String name)
Remove all bookmarks with the given name.- Parameters:
name
- The name to remove.- Returns:
- Number of removed bookmarks.
-
-