Package org.eclipse.ui.texteditor
Class MarkRegionTarget
- java.lang.Object
-
- org.eclipse.ui.texteditor.MarkRegionTarget
-
- All Implemented Interfaces:
IMarkRegionTarget
public class MarkRegionTarget extends Object implements IMarkRegionTarget
Default implementation ofIMarkRegionTargetusingITextViewerandIStatusLineManager.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description MarkRegionTarget(ITextViewer viewer, IStatusLineManager manager)Creates a MarkRegionTaret.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static booleanisVisible(ITextViewer viewer, int offset)Tells whether the given offset is visible in the given text viewer.voidsetMarkAtCursor(boolean set)Sets or clears a mark at the current cursor position.voidswapMarkAndCursor()Swaps the mark and cursor position if the mark is in the visible region.
-
-
-
Constructor Detail
-
MarkRegionTarget
public MarkRegionTarget(ITextViewer viewer, IStatusLineManager manager)
Creates a MarkRegionTaret.- Parameters:
viewer- the text viewermanager- the status line manager
-
-
Method Detail
-
setMarkAtCursor
public void setMarkAtCursor(boolean set)
Description copied from interface:IMarkRegionTargetSets or clears a mark at the current cursor position.- Specified by:
setMarkAtCursorin interfaceIMarkRegionTarget- Parameters:
set- sets the mark iftrue, clears otherwise.
-
swapMarkAndCursor
public void swapMarkAndCursor()
Description copied from interface:IMarkRegionTargetSwaps the mark and cursor position if the mark is in the visible region.- Specified by:
swapMarkAndCursorin interfaceIMarkRegionTarget
-
isVisible
protected static final boolean isVisible(ITextViewer viewer, int offset)
Tells whether the given offset is visible in the given text viewer.- Parameters:
viewer- the text vieweroffset- the offset to check- Returns:
trueif the given offset is visible in the given text viewer- Since:
- 2.1
-
-