Class GotoPreviousBookmarkHandler

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
All Implemented Interfaces:
org.eclipse.core.commands.IHandler, org.eclipse.core.commands.IHandler2

public class GotoPreviousBookmarkHandler extends AbstractNavigateBookmarksHandler
Navigates to bookmark above caret line. If there is no bookmark above caret line, then navigates to the last bookmark in the document. If there are multiple bookmarks on the line then one of those bookmarks is selected. If no appropriate bookmark was found then editor is not changed.
  • Constructor Details

    • GotoPreviousBookmarkHandler

      public GotoPreviousBookmarkHandler()
  • Method Details

    • findTargetBookmark

      protected Optional<org.eclipse.core.resources.IMarker> findTargetBookmark(int caretLine, NavigableMap<Integer,List<org.eclipse.core.resources.IMarker>> bookmarksWithLines)
      Description copied from class: AbstractNavigateBookmarksHandler
      Selects bookmark to navigate to.
      Specified by:
      findTargetBookmark in class AbstractNavigateBookmarksHandler
      Parameters:
      caretLine - 0-based current caret line in the editor. Must not be null.
      bookmarksWithLines - Map where keys are 0-bazed line numbers where bookmarks are present in the active editor and values are list of bookmarks on the corresponding line. Must not be null.
      Returns:
      Bookmark to navigate to or an empty value if target cannot be found or should not navigate anywhere. Never null.