public class MarkSelection extends Object implements IMarkSelection
IMarkSelection
.Constructor and Description |
---|
MarkSelection(IDocument document,
int offset,
int length)
Creates a MarkSelection.
|
Modifier and Type | Method and Description |
---|---|
IDocument |
getDocument()
Returns the marked document.
|
int |
getLength()
Returns the length of the mark selection.
|
int |
getOffset()
Returns the mark position.
|
boolean |
isEmpty()
Returns whether this selection is empty.
|
public MarkSelection(IDocument document, int offset, int length)
document
- the marked documentoffset
- the offset of the marklength
- the length of the mark, may be negative if caret before offsetpublic IDocument getDocument()
IMarkSelection
getDocument
in interface IMarkSelection
public int getOffset()
IMarkSelection
-1
if there's no marked region.getOffset
in interface IMarkSelection
-1
if there is no marked regionpublic int getLength()
IMarkSelection
getOffset()
returns -1
.getLength
in interface IMarkSelection
getOffset == -1
public boolean isEmpty()
ISelection
isEmpty
in interface ISelection
true
if this selection is empty,
and false
otherwiseGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.