Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.text
Interface IBlockTextSelection

All Superinterfaces:
ISelection, ITextSelection
All Known Implementing Classes:
BlockTextSelection

public interface IBlockTextSelection
extends ITextSelection

A rectangular selection in a text document. A column selection spans the visually identical range of columns on a contiguous range of lines. The character count of the same visually perceived column may not be equal for two different lines, therefore computing the set of disjunct character ranges covered by a column selection is influenced by the used font and tabulator width. Using column selections with proportional fonts may render unexpected results.

Virtual Spaces
The start column and end column may refer to "virtual offsets" in the white space beyond the end of the line. Such an offset can be realized by inserting a space for each missing character.

The offset and length of an IBlockTextSelection refer to the smallest non-virtual range that comprises the entire rectangular selection.

Clients may implement this interface or use the default implementation provided by BlockTextSelection.

Since:
3.5
See Also:
BlockTextSelection

Method Summary
 int getEndColumn ()
          Returns the exclusive column on the end line at which the selection ends.
  IRegion[] getRegions ()
          Returns a non-empty array containing the selected text range for each line covered by the selection.
 int getStartColumn ()
          Returns the column on the start line at which the selection starts.
  String getText ()
          Returns the selected text.
 
Methods inherited from interface org.eclipse.jface.text. ITextSelection
getEndLine, getLength, getOffset, getStartLine
 
Methods inherited from interface org.eclipse.jface.viewers. ISelection
isEmpty
 

Method Detail

getStartColumn

int getStartColumn()
Returns the column on the start line at which the selection starts. The returned column is a character count measured from the start of the line. It may be larger than the length of the line, in which case it is a virtual offset.

Returns:
the start column measured from the line start

getEndColumn

int getEndColumn()
Returns the exclusive column on the end line at which the selection ends. The returned column is a character count measured from the start of the line. It may be larger than the length of the line, in which case it is a virtual offset.

Returns:
the end column measured from the line start

getText


String 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.

The returned text does not necessarily correspond to the total offset and length, as only the text within the selected columns is returned.

Any virtual spaces beyond the end of the selected lines are materialized and returned as text.

Specified by:
getText in interface ITextSelection
Returns:
the selected text or null if there is no valid text information
See Also:
ITextSelection.getText()

getRegions


IRegion[] getRegions()
Returns a non-empty array containing the selected text range for each line covered by the selection.

Returns:
an array containing a the covered text range for each line covered by the receiver

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire