Class TextSelection
-
Field Summary
Fields inherited from class com.adobe.xfa.text.TextRange
POSN_ANCHOR, POSN_END, POSN_LOOSE, POSN_START -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.TextSelection(GFXColour oColour, GFXColour oColourBg, TextStream poStream) Constructor with colours and stream.TextSelection(TextSelection oSource) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptioncolour()Obtain the current foreground colour of the selection.voidChange the foreground colour of the selection.colourBg()Obtain the current background colour of the selection.voidChange the background colour of the selection.voidcopyFrom(TextSelection oSource) Assignment operator.booleanEquality comparison.inthashCode()Methods inherited from class com.adobe.xfa.text.TextRange
anchor, anchor, anchor, associate, associate, attribute, attribute, attribute, charPosition, charRange, copyFrom, count, countEmbed, countField, countText, delete, delete, end, end, end, enumerateMarkers, enumerateMarkers, getSelectionRectangles, grabLine, grabPara, grabWord, grabWord, insert, isEmpty, loose, loose, loose, markup, markup, notEqual, position, position, position, replace, replace, replace, replace, replace, replace, start, start, start, stream, text, text, text, tighten, union
-
Constructor Details
-
TextSelection
public TextSelection()Default constructor.Construct a text selection object with no initial stream association. The default foreground colour is white and the default background colour is black.
-
TextSelection
Copy constructor.Copy the source selection object including range and colours.
- Parameters:
oSource- - Source selection to copy.
-
TextSelection
Constructor with colours and stream.Construct a text selection object associated with the given stream and using the given colours. The selection range initially covers the entire text stream.
- Parameters:
oColour- - Foreground colour.oColourBg- - Background colour.poStream- - (optional) Text stream for association. NULL (default) creates the text selection with no initial association.
-
-
Method Details
-
colour
Obtain the current foreground colour of the selection.- Returns:
- Foreground colour.
-
colour
Change the foreground colour of the selection.Note: changing the colour does not automatically cause an invalidation of the selected text in any view.
- Parameters:
oNewColour- - New foreground colour.
-
colourBg
Obtain the current background colour of the selection.- Returns:
- Background colour.
-
colourBg
Change the background colour of the selection.Note: changing the colour does not automatically cause an invalidation of the selected text in any view.
- Parameters:
oNewColourBg- - New background colour.
-
copyFrom
Assignment operator.Copies all attrbutes of the source selection, including underlying text range and colours.
- Parameters:
oSource- - Source selection to copy.
-
equals
Equality comparison.Two selections are considered equal of the represent the same range in the same text stream, and have the same foreground and background colours.
-
hashCode
public int hashCode()
-