Interface ITextSelection
- All Superinterfaces:
- ISelection
- All Known Subinterfaces:
- IBlockTextSelection,- IMultiTextSelection
- All Known Implementing Classes:
- BlockTextSelection,- MultiTextSelection,- TextSelection
 If, for example, the selection provider is a text viewer (
 ITextViewer), and a text selection is created
 for the range [5, 10], the line formation for the 5th character must not be
 determined and remembered at the point of creation. It can rather be
 determined at the point, when getStartLine is called. If the
 source viewer range [0, 15] has been changed in the meantime between the
 creation of the text selection object and the invocation of
 getStartLine, the returned line number may differ from the
 line number of the 5th character at the point of creation of the text
 selection object.
 
The contract of this interface is that weak in order to allow for efficient implementations.
 Clients may implement this interface or use the default implementation
 provided by TextSelection.
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the number of the line containing the last character of the selected text.intReturns the length of the selected text.intReturns the offset of the selected text.intReturns number of the line containing the offset of the selected text.getText()Returns the selected text.Methods inherited from interface org.eclipse.jface.viewers.ISelectionisEmpty
- 
Method Details- 
getOffsetint getOffset()Returns the offset of the selected text.- Returns:
- the offset of the selected text or -1 if there is no valid text information
 
- 
getLengthint getLength()Returns the length of the selected text.- Returns:
- the length of the selected text or -1 if there is no valid text information
 
- 
getStartLineint getStartLine()Returns 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.- Returns:
- the start line of this selection or -1 if there is no valid line information
 
- 
getEndLineint getEndLine()Returns 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.- Returns:
- the end line of this selection or -1 if there is no valid line information
 
- 
getTextString getText()Returns 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.- Returns:
- the selected text or nullif there is no valid text information
 
 
-