Package org.eclipse.jface.text
Class MarkSelection
- java.lang.Object
-
- org.eclipse.jface.text.MarkSelection
-
- All Implemented Interfaces:
IMarkSelection,ISelection
public class MarkSelection extends Object implements IMarkSelection
Default implementation ofIMarkSelection.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description MarkSelection(IDocument document, int offset, int length)Creates a MarkSelection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDocumentgetDocument()Returns the marked document.intgetLength()Returns the length of the mark selection.intgetOffset()Returns the mark position.booleanisEmpty()Returns whether this selection is empty.
-
-
-
Constructor Detail
-
MarkSelection
public MarkSelection(IDocument document, int offset, int length)
Creates a MarkSelection.- Parameters:
document- the marked documentoffset- the offset of the marklength- the length of the mark, may be negative if caret before offset
-
-
Method Detail
-
getDocument
public IDocument getDocument()
Description copied from interface:IMarkSelectionReturns the marked document.- Specified by:
getDocumentin interfaceIMarkSelection- Returns:
- the marked document
-
getOffset
public int getOffset()
Description copied from interface:IMarkSelectionReturns the mark position. The offset may be-1if there's no marked region.- Specified by:
getOffsetin interfaceIMarkSelection- Returns:
- the mark position or
-1if there is no marked region
-
getLength
public int getLength()
Description copied from interface:IMarkSelectionReturns the length of the mark selection. The length may be negative, if the caret is before the mark position. The length has no meaning ifgetOffset()returns-1.- Specified by:
getLengthin interfaceIMarkSelection- Returns:
- the length of the mark selection. Result is undefined for
getOffset == -1
-
isEmpty
public boolean isEmpty()
Description copied from interface:ISelectionReturns whether this selection is empty.- Specified by:
isEmptyin interfaceISelection- Returns:
trueif this selection is empty, andfalseotherwise
-
-