Package ghidra.trace.database.program
Class DBTraceProgramViewBookmarkManager
java.lang.Object
ghidra.trace.database.program.DBTraceProgramViewBookmarkManager
- All Implemented Interfaces:
BookmarkManager,TraceProgramViewBookmarkManager
public class DBTraceProgramViewBookmarkManager
extends Object
implements TraceProgramViewBookmarkManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DBTraceBookmarkManagerprotected static final Bookmark[]protected static final String[]protected final DBTraceProgramViewFields inherited from interface ghidra.program.model.listing.BookmarkManager
OLD_BOOKMARK_PROPERTY_OBJECT_CLASS1, OLD_BOOKMARK_PROPERTY_OBJECT_CLASS2 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondefineType(String type, Icon icon, Color color, int priority) Define a bookmark type with its marker icon and color.protected voidprotected voiddoRemoveByAddressSet(AddressSetView set, TaskMonitor monitor, Predicate<? super TraceBookmark> predicate) protected static <T,U extends T>
Iterator<T> filteredIterator(Iterator<U> it, Predicate<? super U> predicate) A less restrictive casting ofIteratorUtils.filteredIterator(Iterator, org.apache.commons.collections4.Predicate).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.protected Comparator<Bookmark> getBookmarkComparator(boolean forward) intReturns the total number of bookmarks in the programintgetBookmarkCount(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.longgetSnap()getTrace()booleanhasBookmarks(String type) Returns true if program contains one or more bookmarks of the given typebooleanisDefinedType(String type) Returns true if the given bookmark type has been defined via a call toBookmarkManager.defineType(String, Icon, Color, int).voidremoveBookmark(Bookmark bookmark) Remove bookmarkvoidremoveBookmarks(AddressSetView set, TaskMonitor monitor) Removes all bookmarks over the given address set.voidremoveBookmarks(AddressSetView set, String type, TaskMonitor monitor) Removes all bookmarks of the given type over the given address setvoidremoveBookmarks(AddressSetView set, String type, String category, TaskMonitor monitor) Removes all bookmarks of the given type and category over the given address setvoidremoveBookmarks(String type) Removes all bookmarks of the given type.voidremoveBookmarks(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
-
EMPTY_STRING_ARRAY
-
EMPTY_BOOKMARK_ARRAY
-
program
-
bookmarkManager
-
-
Constructor Details
-
DBTraceProgramViewBookmarkManager
-
-
Method Details
-
defineType
Description copied from interface:BookmarkManagerDefine 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.- Specified by:
defineTypein interfaceBookmarkManager- Parameters:
type- bookmark typeicon- marker icon which may get scaledcolor- marker colorpriority- the bookmark priority- Returns:
- bookmark type object
-
isDefinedType
Description copied from interface:BookmarkManagerReturns true if the given bookmark type has been defined via a call toBookmarkManager.defineType(String, Icon, Color, int). This allows clients to know whether the given type should be displayed.- Specified by:
isDefinedTypein interfaceBookmarkManager- Parameters:
type- the type to check- Returns:
- true if defined
-
getBookmarkTypes
Description copied from interface:BookmarkManagerReturns list of known bookmark types- Specified by:
getBookmarkTypesin interfaceBookmarkManager- Returns:
- list of known bookmark types
-
getBookmarkType
Description copied from interface:BookmarkManagerGet a bookmark type- Specified by:
getBookmarkTypein interfaceBookmarkManager- Parameters:
type- bookmark type name- Returns:
- bookmark type or null if type is unknown
-
getCategories
Description copied from interface:BookmarkManagerGet list of categories used for a specified type- Specified by:
getCategoriesin interfaceBookmarkManager- Parameters:
type- bookmark type- Returns:
- array of category strings
-
setBookmark
Description copied from interface:BookmarkManagerSet a bookmark.- Specified by:
setBookmarkin interfaceBookmarkManager- 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
Description copied from interface:BookmarkManagerGet a specific bookmark- Specified by:
getBookmarkin interfaceBookmarkManager- 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.
-
doDeleteOrTruncateLifespan
-
removeBookmark
Description copied from interface:BookmarkManagerRemove bookmark- Specified by:
removeBookmarkin interfaceBookmarkManager- Parameters:
bookmark- the bookmark to remove.
-
removeBookmarks
Description copied from interface:BookmarkManagerRemoves all bookmarks of the given type.- Specified by:
removeBookmarksin interfaceBookmarkManager- Parameters:
type- bookmark type
-
removeBookmarks
public void removeBookmarks(String type, String category, TaskMonitor monitor) throws CancelledException Description copied from interface:BookmarkManagerRemoves all bookmarks with the given type and category.- Specified by:
removeBookmarksin interfaceBookmarkManager- 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.
-
doRemoveByAddressSet
protected void doRemoveByAddressSet(AddressSetView set, TaskMonitor monitor, Predicate<? super TraceBookmark> predicate) throws CancelledException - Throws:
CancelledException
-
removeBookmarks
Description copied from interface:BookmarkManagerRemoves all bookmarks over the given address set.- Specified by:
removeBookmarksin interfaceBookmarkManager- 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
public void removeBookmarks(AddressSetView set, String type, TaskMonitor monitor) throws CancelledException Description copied from interface:BookmarkManagerRemoves all bookmarks of the given type over the given address set- Specified by:
removeBookmarksin interfaceBookmarkManager- 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
public void removeBookmarks(AddressSetView set, String type, String category, TaskMonitor monitor) throws CancelledException Description copied from interface:BookmarkManagerRemoves all bookmarks of the given type and category over the given address set- Specified by:
removeBookmarksin interfaceBookmarkManager- 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
Description copied from interface:BookmarkManagerGet all bookmarks on a specific address- Specified by:
getBookmarksin interfaceBookmarkManager- Parameters:
addr- the address at which to retrieve all bookmarks.- Returns:
- array of bookmarks
-
getBookmarks
Description copied from interface:BookmarkManagerGet bookmarks of the indicated type on a specific address- Specified by:
getBookmarksin interfaceBookmarkManager- Parameters:
address- the address at which to search for bookmarks.type- bookmark type to search for- Returns:
- array of bookmarks
-
getBookmarkAddresses
Description copied from interface:BookmarkManagerGet addresses for bookmarks of a specified type.- Specified by:
getBookmarkAddressesin interfaceBookmarkManager- Parameters:
type- bookmark type- Returns:
- address set containing bookmarks of the specified type.
-
filteredIterator
protected static <T,U extends T> Iterator<T> filteredIterator(Iterator<U> it, Predicate<? super U> predicate) A less restrictive casting ofIteratorUtils.filteredIterator(Iterator, org.apache.commons.collections4.Predicate).This one understands that the predicate will be testing things of the (possibly more-specific) type of elements in the original iterator, not that of the returned iterator.
- Parameters:
it- the iteratorpredicate- the predicate- Returns:
- the iterator
-
getBookmarksIterator
Description copied from interface:BookmarkManagerGet iterator over all bookmarks of the specified type.- Specified by:
getBookmarksIteratorin interfaceBookmarkManager- Parameters:
type- the bookmark type to search for- Returns:
- an iterator over all bookmarks of the specified type.
-
getBookmarksIterator
Description copied from interface:BookmarkManagerReturns an iterator over all bookmarks- Specified by:
getBookmarksIteratorin interfaceBookmarkManager- Returns:
- an iterator over all bookmarks
-
getBookmarkComparator
-
getBookmarksIterator
Description copied from interface:BookmarkManagerReturns an iterator over all bookmark types, starting at the given address, with traversal in the given direction.- Specified by:
getBookmarksIteratorin interfaceBookmarkManager- 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
Description copied from interface:BookmarkManagerReturns the bookmark that has the given id or null if no such bookmark exists.- Specified by:
getBookmarkin interfaceBookmarkManager- Parameters:
id- the id of the bookmark to be retrieved.- Returns:
- the bookmark
-
hasBookmarks
Description copied from interface:BookmarkManagerReturns true if program contains one or more bookmarks of the given type- Specified by:
hasBookmarksin interfaceBookmarkManager- Parameters:
type- the type of bookmark to check for.- Returns:
- true if program contains one or more bookmarks of the given type
-
getBookmarkCount
Description copied from interface:BookmarkManagerReturn the number of bookmarks of the given type- Specified by:
getBookmarkCountin interfaceBookmarkManager- Parameters:
type- the type of bookmarks to count- Returns:
- the number of bookmarks of the given type
-
getBookmarkCount
public int getBookmarkCount()Description copied from interface:BookmarkManagerReturns the total number of bookmarks in the program- Specified by:
getBookmarkCountin interfaceBookmarkManager- Returns:
- the total number of bookmarks in the program
-
getTrace
-
getSnap
public long getSnap() -
getProgram
Description copied from interface:BookmarkManagerReturns the program associated with this BookmarkManager.- Specified by:
getProgramin interfaceBookmarkManager- Specified by:
getProgramin interfaceTraceProgramViewBookmarkManager- Returns:
- the program associated with this BookmarkManager.
-