Interface BookmarkManager

  • All Known Implementing Classes:
    BookmarkDBManager

    public interface BookmarkManager
    Interface for managing bookmarks.
    • Field Detail

      • OLD_BOOKMARK_PROPERTY_OBJECT_CLASS1

        static final java.lang.String OLD_BOOKMARK_PROPERTY_OBJECT_CLASS1
        1st version of bookmark property object class (schema change and class moved)
        See Also:
        Constant Field Values
      • OLD_BOOKMARK_PROPERTY_OBJECT_CLASS2

        static final java.lang.String OLD_BOOKMARK_PROPERTY_OBJECT_CLASS2
        2nd version of bookmark property object class (class moved, property map no longer used)
        See Also:
        Constant Field Values
    • Method Detail

      • defineType

        BookmarkType defineType​(java.lang.String type,
                                javax.swing.ImageIcon icon,
                                java.awt.Color color,
                                int priority)
        Define a bookmark type with its marker icon and color. The icon and color values are not permanently stored. Therefor, this method must be re-invoked by a plugin each time a program is opened if a custom icon and color are desired.
        Parameters:
        type - bookmark type
        icon - marker icon which may get scaled
        color - marker color
        priority - the bookmark priority
        Returns:
        bookmark type object
        Throws:
        java.lang.IllegalArgumentException - if any of the arguments are null or if the type is empty
      • getBookmarkTypes

        BookmarkType[] getBookmarkTypes()
        Returns list of known bookmark types
        Returns:
        list of known bookmark types
      • getBookmarkType

        BookmarkType getBookmarkType​(java.lang.String type)
        Get a bookmark type
        Parameters:
        type - bookmark type name
        Returns:
        bookmark type or null if type is unknown
      • getCategories

        java.lang.String[] getCategories​(java.lang.String type)
        Get list of categories used for a specified type
        Parameters:
        type - bookmark type
        Returns:
        array of category strings
      • setBookmark

        Bookmark setBookmark​(Address addr,
                             java.lang.String type,
                             java.lang.String category,
                             java.lang.String comment)
        Set a bookmark.
        Parameters:
        addr - the address at which to set a bookmark
        type - the name of the bookmark type.
        category - the category for the bookmark.
        comment - the comment to associate with the bookmark.
        Returns:
        the new bookmark
      • getBookmark

        Bookmark getBookmark​(Address addr,
                             java.lang.String type,
                             java.lang.String category)
        Get a specific bookmark
        Parameters:
        addr - the address of the bookmark to retrieve
        type - the name of the bookmark type.
        category - the category of the bookmark.
        Returns:
        the bookmark with the given attributes, or null if no bookmarks match.
      • removeBookmark

        void removeBookmark​(Bookmark bookmark)
        Remove bookmark
        Parameters:
        bookmark - the bookmark to remove.
      • removeBookmarks

        void removeBookmarks​(java.lang.String type)
        Removes all bookmarks of the given type.
        Parameters:
        type - bookmark type
      • removeBookmarks

        void removeBookmarks​(java.lang.String type,
                             java.lang.String category,
                             TaskMonitor monitor)
                      throws CancelledException
        Removes all bookmarks with the given type and category.
        Parameters:
        type - the type of the bookmarks to be removed.
        category - bookmark category of the types to be removed.
        monitor - a task monitor to report the progress.
        Throws:
        CancelledException - if the user (via the monitor) cancelled the operation.
      • removeBookmarks

        void removeBookmarks​(AddressSetView set,
                             TaskMonitor monitor)
                      throws CancelledException
        Removes all bookmarks over the given address set.
        Parameters:
        set - the set of addresses from which to remove all bookmarks.
        monitor - a task monitor to report the progress.
        Throws:
        CancelledException - if the user (via the monitor) cancelled the operation.
      • removeBookmarks

        void removeBookmarks​(AddressSetView set,
                             java.lang.String type,
                             TaskMonitor monitor)
                      throws CancelledException
        Removes all bookmarks of the given type over the given address set
        Parameters:
        set - the set of addresses from which to remove all bookmarks of the given type.
        type - the type of bookmarks to remove.
        monitor - a task monitor to report the progress.
        Throws:
        CancelledException - if the user (via the monitor) cancelled the operation.
      • removeBookmarks

        void removeBookmarks​(AddressSetView set,
                             java.lang.String type,
                             java.lang.String category,
                             TaskMonitor monitor)
                      throws CancelledException
        Removes all bookmarks of the given type and category over the given address set
        Parameters:
        set - the set of addresses from which to remove all bookmarks of the given type and category.
        type - the type of bookmarks to remove.
        category - the category of bookmarks to remove.
        monitor - a task monitor to report the progress.
        Throws:
        CancelledException - if the user (via the monitor) cancelled the operation.
      • getBookmarks

        Bookmark[] getBookmarks​(Address address,
                                java.lang.String type)
        Get bookmarks of the indicated type on a specific address
        Parameters:
        address - the address at which to search for bookmarks.
        type - bookmark type to search for
        Returns:
        array of bookmarks
      • getBookmarks

        Bookmark[] getBookmarks​(Address addr)
        Get all bookmarks on a specific address
        Parameters:
        addr - the address at which to retrieve all bookmarks.
        Returns:
        array of bookmarks
      • getBookmarkAddresses

        AddressSetView getBookmarkAddresses​(java.lang.String type)
        Get addresses for bookmarks of a specified type.
        Parameters:
        type - bookmark type
        Returns:
        address set containing bookmarks of the specified type.
      • getBookmarksIterator

        java.util.Iterator<Bookmark> getBookmarksIterator​(java.lang.String type)
        Get iterator over all bookmarks of the specified type.
        Parameters:
        type - the bookmark type to search for
        Returns:
        an iterator over all bookmarks of the specified type.
      • getBookmarksIterator

        java.util.Iterator<Bookmark> getBookmarksIterator()
        Returns an iterator over all bookmarks
        Returns:
        an iterator over all bookmarks
      • getBookmarksIterator

        java.util.Iterator<Bookmark> getBookmarksIterator​(Address startAddress,
                                                          boolean forward)
        Returns an iterator over all bookmark types, starting at the given address, with traversal in the given direction.
        Parameters:
        startAddress - the address at which to start
        forward - true to iterate in the forward direction; false for backwards
        Returns:
        an iterator over all bookmark types, starting at the given address, with traversal in the given direction.
      • getBookmark

        Bookmark getBookmark​(long id)
        Returns the bookmark that has the given id or null if no such bookmark exists.
        Parameters:
        id - the id of the bookmark to be retrieved.
        Returns:
        the bookmark
      • hasBookmarks

        boolean hasBookmarks​(java.lang.String type)
        Returns true if program contains one or more bookmarks of the given type
        Parameters:
        type - the type of bookmark to check for.
        Returns:
        true if program contains one or more bookmarks of the given type
      • getBookmarkCount

        int getBookmarkCount​(java.lang.String type)
        Return the number of bookmarks of the given type
        Parameters:
        type - the type of bookmarks to count
        Returns:
        the number of bookmarks of the given type
      • getBookmarkCount

        int getBookmarkCount()
        Returns the total number of bookmarks in the program
        Returns:
        the total number of bookmarks in the program
      • getProgram

        Program getProgram()
        Returns the program associated with this BookmarkManager.
        Returns:
        the program associated with this BookmarkManager.