Class BookmarkManager

java.lang.Object
com.pnfsoftware.jeb.core.BookmarkManager
All Implemented Interfaces:
IEventListener

@Ser public class BookmarkManager extends Object implements IEventListener
Bookmark manager used by JEB projects.
  • Constructor Details

    • BookmarkManager

      public BookmarkManager()
      Create an empty bookmark manager.
  • Method Details

    • onEvent

      public void onEvent(IEvent e)
      React to project events in order to clean up bookmarks for destroyed units.
      Specified by:
      onEvent in interface IEventListener
      Parameters:
      e - event to process
    • set

      public void set(IUnit unit, String address, String description)
      Add or update a bookmark. A meta-comment is auto-generated.
      Parameters:
      unit - mandatory
      address - an address, as defined in IAddressableUnit; null is accepted as well to bookmark the unit as a whole, whether it be addressable or not
      description - non-null description
    • set

      public void set(IUnit unit, String address, String description, boolean doNotGenerateMetaComments)
      Add or update a bookmark.
      Parameters:
      unit - mandatory
      address - an address, as defined in IAddressableUnit; null is accepted as well to bookmark the unit as a whole, whether it be addressable or not
      description - non-null description
      doNotGenerateMetaComments - if true, no associated meta-comment with the flag COMMENT_FLAG_FAVORITE will be generated
    • get

      public String get(IUnit unit, String address)
      Retrieve a bookmark.
      Parameters:
      unit - bookmarked unit
      address - 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

      public List<BookmarkManager.Bookmark> getAll()
      Retrieve every bookmark managed by this instance.
      Returns:
      all bookmarks, possibly empty
    • remove

      public boolean remove(IUnit unit, String address)
      Remove a bookmark from a unit or unit address.
      Parameters:
      unit - target unit
      address - bookmarked address, or null for a unit-level bookmark
      Returns:
      true if a bookmark was removed
    • remove

      public boolean remove(IUnit unit)
      Remove all bookmarks associated with a unit.
      Parameters:
      unit - target unit
      Returns:
      true if at least one bookmark existed and was removed