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
Class BlockTextSelection


java.lang.Object
  extended by 

org.eclipse.jface.text.TextSelection
      extended by 
org.eclipse.jface.text.BlockTextSelection
All Implemented Interfaces:
IBlockTextSelection, ITextSelection, ISelection

public class BlockTextSelection
extends TextSelection
implements IBlockTextSelection

Standard implementation of IBlockTextSelection.

Since:
3.5

Constructor Summary
BlockTextSelection ( IDocument document, int startLine, int startColumn, int endLine, int endColumn, int tabWidth)
          Creates a column selection for the given lines and columns.
 
Method Summary
 boolean equals ( Object obj)
           
 int getEndColumn ()
          Returns the exclusive column on the end line at which the selection ends.
 int getEndLine ()
          Returns the number of the line containing the last character of the selected text.
  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.
 int getStartLine ()
          Returns number of the line containing the offset of the selected text.
  String getText ()
          Returns the selected text.
 int hashCode ()
           
 
Methods inherited from class org.eclipse.jface.text. TextSelection
emptySelection, getDocument, getLength, getOffset, isEmpty
 
Methods inherited from class java.lang. Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.text. ITextSelection
getLength, getOffset
 
Methods inherited from interface org.eclipse.jface.viewers. ISelection
isEmpty
 

Constructor Detail

BlockTextSelection

public BlockTextSelection(
IDocument document,
                          int startLine,
                          int startColumn,
                          int endLine,
                          int endColumn,
                          int tabWidth)
Creates a column selection for the given lines and columns.

Parameters:
document - the document that this selection refers to
startLine - the start line
startColumn - the possibly virtual start column, measured in characters from the start of startLine
endLine - the inclusive end line
endColumn - the exclusive and possibly virtual end column, measured in characters from the start of endLine
tabWidth - the tabulator width used to compute the visual offsets from character offsets
Method Detail

getStartLine

public int getStartLine()
Description copied from interface: ITextSelection
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.

Specified by:
getStartLine in interface ITextSelection
Overrides:
getStartLine in class TextSelection
Returns:
the start line of this selection or -1 if there is no valid line information

getStartColumn

public int getStartColumn()
Description copied from interface: IBlockTextSelection
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.

Specified by:
getStartColumn in interface IBlockTextSelection
Returns:
the start column measured from the line start

getEndLine

public int getEndLine()
Description copied from interface: ITextSelection
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.

Specified by:
getEndLine in interface ITextSelection
Overrides:
getEndLine in class TextSelection
Returns:
the end line of this selection or -1 if there is no valid line information

getEndColumn

public int getEndColumn()
Description copied from interface: IBlockTextSelection
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.

Specified by:
getEndColumn in interface IBlockTextSelection
Returns:
the end column measured from the line start

getText

public 
String getText()
Description copied from interface: ITextSelection
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.

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

hashCode

public int hashCode()
Overrides:
hashCode in class TextSelection

equals

public boolean equals(
Object obj)
Overrides:
equals in class TextSelection

getRegions

public 
IRegion[] getRegions()
Description copied from interface: IBlockTextSelection
Returns a non-empty array containing the selected text range for each line covered by the selection.

Specified by:
getRegions in interface IBlockTextSelection
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