Package org.eclipse.jface.text
Class MultiTextSelection
- java.lang.Object
-
- org.eclipse.jface.text.MultiTextSelection
-
- All Implemented Interfaces:
IMultiTextSelection,ITextSelection,ISelection
public class MultiTextSelection extends Object implements IMultiTextSelection
- Since:
- 3.19
-
-
Constructor Summary
Constructors Constructor Description MultiTextSelection(IDocument document, IRegion[] regions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetEndLine()Returns the number of the line containing the last character of the selected text.intgetLength()Returns the length of the selected text.intgetOffset()Returns the offset of the selected text.IRegion[]getRegions()Returns a non-empty array containing the selected text range for each line covered by the selection.intgetStartLine()Returns number of the line containing the offset of the selected text.StringgetText()Returns the selected text.booleanisEmpty()Returns whether this selection is empty.
-
-
-
Method Detail
-
getOffset
public int getOffset()
Description copied from interface:ITextSelectionReturns the offset of the selected text.- Specified by:
getOffsetin interfaceITextSelection- Returns:
- the offset of the selected text or -1 if there is no valid text information
-
getLength
public int getLength()
Description copied from interface:ITextSelectionReturns the length of the selected text.- Specified by:
getLengthin interfaceITextSelection- Returns:
- the length of the selected text or -1 if there is no valid text information
-
getStartLine
public int getStartLine()
Description copied from interface:ITextSelectionReturns number of the line containing the offset of the selected text. If the underlying text has been changed between the creation of this selection object and the call of this method, the value returned might differ from what it would have been at the point of creation.- Specified by:
getStartLinein interfaceITextSelection- Returns:
- the start line of this selection or -1 if there is no valid line information
-
getEndLine
public int getEndLine()
Description copied from interface:ITextSelectionReturns the number of the line containing the last character of the selected text. If the underlying text has been changed between the creation of this selection object and the call of this method, the value returned might differ from what it would have been at the point of creation.- Specified by:
getEndLinein interfaceITextSelection- Returns:
- the end line of this selection or -1 if there is no valid line information
-
getText
public String getText()
Description copied from interface:ITextSelectionReturns the selected text. If the underlying text has been changed between the creation of this selection object and the call of this method, the value returned might differ from what it would have been at the point of creation.- Specified by:
getTextin interfaceITextSelection- Returns:
- the selected text or
nullif there is no valid text information
-
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
-
getRegions
public IRegion[] getRegions()
Description copied from interface:IMultiTextSelectionReturns a non-empty array containing the selected text range for each line covered by the selection.- Specified by:
getRegionsin interfaceIMultiTextSelection- Returns:
- an array containing a the covered text range for each line covered by the receiver
-
-