Package com.pnfsoftware.jeb.core
Class BookmarkManager
java.lang.Object
com.pnfsoftware.jeb.core.BookmarkManager
- All Implemented Interfaces:
IEventListener
Bookmark manager used by JEB projects.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve all bookmarks defined for a unit.Retrieve a bookmark.getAll()Retrieve every bookmark managed by this instance.voidReact to project events in order to clean up bookmarks for destroyed units.booleanRemove all bookmarks associated with a unit.booleanRemove a bookmark from a unit or unit address.voidAdd or update a bookmark.voidAdd or update a bookmark.
-
Constructor Details
-
BookmarkManager
public BookmarkManager()Create an empty bookmark manager.
-
-
Method Details
-
onEvent
React to project events in order to clean up bookmarks for destroyed units.- Specified by:
onEventin interfaceIEventListener- Parameters:
e- event to process
-
set
Add or update a bookmark. A meta-comment is auto-generated.- Parameters:
unit- mandatoryaddress- an address, as defined inIAddressableUnit; null is accepted as well to bookmark the unit as a whole, whether it be addressable or notdescription- non-null description
-
set
Add or update a bookmark.- Parameters:
unit- mandatoryaddress- an address, as defined inIAddressableUnit; null is accepted as well to bookmark the unit as a whole, whether it be addressable or notdescription- non-null descriptiondoNotGenerateMetaComments- if true, no associated meta-comment with the flagCOMMENT_FLAG_FAVORITEwill be generated
-
get
Retrieve a bookmark.- Parameters:
unit- bookmarked unitaddress- bookmarked address, or null for a unit-level bookmark- Returns:
- the bookmark description, or null if no bookmark exists
-
get
Retrieve all bookmarks defined for a unit.- Parameters:
unit- target unit- Returns:
- bookmarks for the unit, or an empty collection if none exist
-
getAll
Retrieve every bookmark managed by this instance.- Returns:
- all bookmarks, possibly empty
-
remove
Remove a bookmark from a unit or unit address.- Parameters:
unit- target unitaddress- bookmarked address, or null for a unit-level bookmark- Returns:
- true if a bookmark was removed
-
remove
Remove all bookmarks associated with a unit.- Parameters:
unit- target unit- Returns:
- true if at least one bookmark existed and was removed
-