Package gaiasky.interafce
Class BookmarksManager
java.lang.Object
gaiasky.interafce.BookmarksManager
- All Implemented Interfaces:
IObserver
public class BookmarksManager extends java.lang.Object implements IObserver
Manages the bookmarks in Gaia Sky. Supports folders.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBookmarksManager.BNode -
Field Summary
Fields Modifier and Type Field Description static BookmarksManagerinstance -
Method Summary
Modifier and Type Method Description booleanaddBookmark(java.lang.String path, boolean folder)Adds a bookmark with the given path.booleancontainsName(java.lang.String name)booleancontainsNameRec(java.lang.String name, BookmarksManager.BNode node)booleancontainsPath(java.lang.String path)booleancontainsPath(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 voidinitialize()static BookmarksManagerinstance()voidnotify(Events event, java.lang.Object... data)voidpersistBookmarks()booleanremoveBookmark(java.lang.String path)Removes a bookmark by its path.intremoveBookmarksByName(java.lang.String name)Remove all bookmarks with the given name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
instance
-
-
Method Details
-
initialize
public static void initialize() -
instance
-
getBookmarks
-
getFolders
- Returns:
- A list with all folder bookmarks
-
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
-
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.
-
notify
-