|
Eclipse Platform 2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.eclipse.jface.text.TextSelection
Standard implementation of ITextSelection.
Makes advantage of the weak contract of correctness of its
interface. If generated from a selection provider, it only
remembers its offset and length and computes the remaining
information on request.
| Constructor Summary | |
TextSelection(IDocument document,
int offset,
int length)
Creates a text selection for the given range of the given document. |
|
TextSelection(int offset,
int length)
Creates a text selection for the given range. |
|
| Method Summary | |
static ITextSelection |
emptySelection()
Returns a shared instance of an empty text selection. |
boolean |
equals(Object obj)
|
int |
getEndLine()
Returns the number of the line containing the last character of the selected text. |
int |
getLength()
Returns the length of the selected text. |
int |
getOffset()
Returns the offset of the selected text. |
int |
getStartLine()
Returns number of the line containing the offset of the selected text. |
String |
getText()
Returns the selected text. |
int |
hashCode()
|
boolean |
isEmpty()
Returns true if the offset and length are smaller than 0. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TextSelection(int offset,
int length)
setSelection
method of selection providers.offset - the offset of the rangelength - the length of the range
public TextSelection(IDocument document,
int offset,
int length)
getSelection.document - the document whose text range is selected in a vieweroffset - the offset of the selected rangelength - the length of the selected range| Method Detail |
public static ITextSelection emptySelection()
public boolean isEmpty()
isEmpty in interface ISelectionorg.eclipse.jface.viewers.ISelectiontrue if this selection is empty,
and false otherwisepublic int getOffset()
ITextSelectiongetOffset in interface ITextSelectionorg.eclipse.jface.text.ITextSelectionpublic int getLength()
ITextSelectiongetLength in interface ITextSelectionorg.eclipse.jface.text.ITextSelectionpublic int getStartLine()
ITextSelectiongetStartLine in interface ITextSelectionorg.eclipse.jface.text.ITextSelectionpublic int getEndLine()
ITextSelectiongetEndLine in interface ITextSelectionorg.eclipse.jface.text.ITextSelectionpublic String getText()
ITextSelectiongetText in interface ITextSelectionorg.eclipse.jface.text.ITextSelectionnull if there is no valid text informationpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
Eclipse Platform 2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||