Package ghidra.program.model.listing
Interface BookmarkManager
- All Known Implementing Classes:
BookmarkDBManager
public interface BookmarkManager
Interface for managing bookmarks.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefineType
(String type, Icon icon, Color color, int priority) Define a bookmark type with its marker icon and color.getBookmark
(long id) Returns the bookmark that has the given id or null if no such bookmark exists.getBookmark
(Address addr, String type, String category) Get a specific bookmarkgetBookmarkAddresses
(String type) Get addresses for bookmarks of a specified type.int
Returns the total number of bookmarks in the programint
getBookmarkCount
(String type) Return the number of bookmarks of the given typeBookmark[]
getBookmarks
(Address addr) Get all bookmarks on a specific addressBookmark[]
getBookmarks
(Address address, String type) Get bookmarks of the indicated type on a specific addressReturns an iterator over all bookmarksgetBookmarksIterator
(Address startAddress, boolean forward) Returns an iterator over all bookmark types, starting at the given address, with traversal in the given direction.getBookmarksIterator
(String type) Get iterator over all bookmarks of the specified type.getBookmarkType
(String type) Get a bookmark typeReturns list of known bookmark typesString[]
getCategories
(String type) Get list of categories used for a specified typeReturns the program associated with this BookmarkManager.boolean
hasBookmarks
(String type) Returns true if program contains one or more bookmarks of the given typevoid
removeBookmark
(Bookmark bookmark) Remove bookmarkvoid
removeBookmarks
(AddressSetView set, TaskMonitor monitor) Removes all bookmarks over the given address set.void
removeBookmarks
(AddressSetView set, String type, TaskMonitor monitor) Removes all bookmarks of the given type over the given address setvoid
removeBookmarks
(AddressSetView set, String type, String category, TaskMonitor monitor) Removes all bookmarks of the given type and category over the given address setvoid
removeBookmarks
(String type) Removes all bookmarks of the given type.void
removeBookmarks
(String type, String category, TaskMonitor monitor) Removes all bookmarks with the given type and category.setBookmark
(Address addr, String type, String category, String comment) Set a bookmark.
-
Field Details
-
OLD_BOOKMARK_PROPERTY_OBJECT_CLASS1
1st version of bookmark property object class (schema change and class moved)- See Also:
-
OLD_BOOKMARK_PROPERTY_OBJECT_CLASS2
2nd version of bookmark property object class (class moved, property map no longer used)- See Also:
-
-
Method Details
-
defineType
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 typeicon
- marker icon which may get scaledcolor
- marker colorpriority
- the bookmark priority- Returns:
- bookmark type object
- Throws:
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
Get a bookmark type- Parameters:
type
- bookmark type name- Returns:
- bookmark type or null if type is unknown
-
getCategories
Get list of categories used for a specified type- Parameters:
type
- bookmark type- Returns:
- array of category strings
-
setBookmark
Set a bookmark.- Parameters:
addr
- the address at which to set a bookmarktype
- 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
Get a specific bookmark- Parameters:
addr
- the address of the bookmark to retrievetype
- 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
Remove bookmark- Parameters:
bookmark
- the bookmark to remove.
-
removeBookmarks
Removes all bookmarks of the given type.- Parameters:
type
- bookmark type
-
removeBookmarks
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
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, 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, String type, 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
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
Get all bookmarks on a specific address- Parameters:
addr
- the address at which to retrieve all bookmarks.- Returns:
- array of bookmarks
-
getBookmarkAddresses
Get addresses for bookmarks of a specified type.- Parameters:
type
- bookmark type- Returns:
- address set containing bookmarks of the specified type.
-
getBookmarksIterator
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
Returns an iterator over all bookmarks- Returns:
- an iterator over all bookmarks
-
getBookmarksIterator
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 startforward
- 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
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
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
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.
-