Class TextSelection.Range
- java.lang.Object
-
- org.faceless.pdf2.viewer2.feature.TextSelection.Range
-
- Enclosing class:
- TextSelection
public abstract static class TextSelection.Range extends Object
A Range represents a selected range ofPageExtractor.Text
items. The range may only cover a single page
-
-
Constructor Summary
Constructors Constructor Description Range()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static TextSelection.Range
createRange(PageExtractor.Text text)
Create a new Range that matches the specified text itemstatic TextSelection.Range
createRange(PageExtractor.Text first, int firstposition, PageExtractor.Text last, int lastposition)
Create a new Range that covers the range of text fromfirst
characterfirstposition
. tolast
characterlastposition
inclusive.abstract PageExtractor.Text
getFirst()
Return the firstPageExtractor.Text
object that is selectedabstract int
getFirstPosition()
Return offset into the Text item returned bygetFirst()
that begins the selection.abstract PageExtractor.Text
getLast()
Return the lastPageExtractor.Text
object that is selectedabstract int
getLastPosition()
Return offset into the Text item returned bygetLast()
that ends the selection.PDFPage
getPage()
Return thePDFPage
this range object relates to.AttributedString
getStyledText()
Return the text this Range coversStringBuffer
getText()
Return the text this Range coversabstract boolean
isValid()
Return true if this Range is valid, false otherwise
-
-
-
Method Detail
-
getFirst
public abstract PageExtractor.Text getFirst()
Return the firstPageExtractor.Text
object that is selected
-
getLast
public abstract PageExtractor.Text getLast()
Return the lastPageExtractor.Text
object that is selected
-
getFirstPosition
public abstract int getFirstPosition()
Return offset into the Text item returned bygetFirst()
that begins the selection.
-
getLastPosition
public abstract int getLastPosition()
Return offset into the Text item returned bygetLast()
that ends the selection. Note this is the offset of the last selected character, not the first unselected character.
-
getText
public StringBuffer getText()
Return the text this Range covers
-
getStyledText
public AttributedString getStyledText()
Return the text this Range covers
-
isValid
public abstract boolean isValid()
Return true if this Range is valid, false otherwise
-
createRange
public static TextSelection.Range createRange(PageExtractor.Text text)
Create a new Range that matches the specified text item
-
createRange
public static TextSelection.Range createRange(PageExtractor.Text first, int firstposition, PageExtractor.Text last, int lastposition)
Create a new Range that covers the range of text fromfirst
characterfirstposition
. tolast
characterlastposition
inclusive.- Parameters:
first
- the first textfirstposition
- the offset into the first text to start atlast
- the last textlastposition
- the offset into the last text to end at
-
-