Interface BookmarksUtil


  • public interface BookmarksUtil
    A set of utility methods to manipulate the bookmarks.

    Module: property-api

    To use this in your app, include the following dependency in your POM:

    <dependency>
        <groupId>org.cytoscape</groupId>
        <artifactId>property-api</artifactId>
    </dependency>

    Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
    • Method Detail

      • getDataSourceList

        List<DataSource> getDataSourceList​(String categoryName,
                                           List<Category> categoryList)
        Traverse bookmark tree and get a list of data sources from the specified category.
        Parameters:
        categoryName - the specified category to get a list of data sources from.
        categoryList - the list of categories to traverse for the specified category.
        Returns:
        a list of data sources from the specified category.
      • getCategory

        Category getCategory​(String categoryName,
                             List<Category> categoryList)
        Select specific category from a list of categories.
        Parameters:
        categoryName - the category to select.
        categoryList - the list of categories to select from.
        Returns:
        the Category that was selected.
      • getAttribute

        String getAttribute​(DataSource source,
                            String attrName)
        Given the attribute name, return the value in a bookmark
        Parameters:
        source - a bookmark object
        attrName - an attribute name
        Returns:
        The value related to the attribute name
      • saveBookmark

        void saveBookmark​(Bookmarks pBookmarks,
                          String pCategoryName,
                          DataSource pDataSource)
        Store a bookmark object in bookmarks object
        Parameters:
        pBookmarks - bookmarks object
        pCategoryName - category name
        pDataSource - a single bookmark
      • saveBookmark

        void saveBookmark​(Bookmarks pBookmarks,
                          String pCategoryName,
                          DataSource pDataSource,
                          String pProvider)
        Store a bookmark object in bookmarks object
        Parameters:
        pBookmarks - bookmarks object
        pCategoryName - category name
        pDataSource - a single bookmark
        pProvider - the name of provider
      • deleteBookmark

        boolean deleteBookmark​(Bookmarks pBookmarks,
                               String pCategoryName,
                               DataSource pDataSource)
        Delete a bookmark (pDataSource) from the category (pCategoryName) in the bookmarks object (pBookmarks)
        Parameters:
        pBookmarks - Bookmark object, which hold a set of bookmark
        pCategoryName - category name
        pDataSource - a single bookmark object
        Returns:
        True if the bookmark is deleted successfully, False otherwise.
      • containsBookmarks

        boolean containsBookmarks​(Bookmarks pBookmarks,
                                  String pCategoryName,
                                  DataSource pDataSource)
        Check if a bookmark is in the bookmarks.
        Parameters:
        pBookmarks - bookmarks object
        pCategoryName - category name
        pDataSource - a bookmark
        Returns:
        True if the bookmark is in bookmarks, False otherwise
      • getProvider

        String getProvider​(DataSource pDataSource)
        Get the provider name from DataSource object
        Parameters:
        pDataSource - a single bookmark