Class ToggleRulerBookmarkHandler

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 ToggleRulerBookmarkHandler extends AbstractToggleBookmarkHandler
Handles toggle bookmark command from editor ruler. An editor has to be IVerticalRulerInfo-adaptable to be able to determine document line corresponding to bookmark position. If bookmark line cannot be determined then no bookmarks will be added or deleted.
  • Constructor Details

    • ToggleRulerBookmarkHandler

      public ToggleRulerBookmarkHandler()
  • Method Details

    • calculateActiveLine

      protected OptionalInt calculateActiveLine(org.eclipse.ui.texteditor.ITextEditor editor)
      Description copied from class: AbstractToggleBookmarkHandler
      Calculates document line where bookmark us supposed to be added or deleted.
      Specified by:
      calculateActiveLine in class AbstractToggleBookmarkHandler
      Parameters:
      editor - Editor where bookmark is to be added or deleted. Must not be null.
      Returns:
      0-based document line number where bookmarks has to be added or deleted or an empty value if active line cannot be determined. Never null.
    • createBookmark

      protected void createBookmark(org.eclipse.ui.texteditor.ITextEditor editor, org.eclipse.core.resources.IResource resource, int activeLine)
      Description copied from class: AbstractToggleBookmarkHandler
      Creates a bookmark.
      Specified by:
      createBookmark in class AbstractToggleBookmarkHandler
      Parameters:
      editor - Editor where bookmark is to be created. Must not be null.
      resource - Resource that is being edited. Must not be null.
      activeLine - 0-based document line where bookmark is to be created.