public interface IlvTextInterface extends IlvLabelInterface
IlvTextInterface
defines an interface for WYSIWYG editing
with the IlvTextSelection
and IlvTextEditor
classes.
This interface provides a caret shape for use while editing text.
Call getCaretShape(IlvTextSelection.Range, IlvTransformer)
to show
the cursor insert position and currently selected text.
Call pickCharacter(IlvPoint, IlvTransformer)
to test the character
clicked by the user in a label.
Graphic objects implementing this interface have automatic in-place WYSIWYG editing.
IlvTextSelection
,
IlvTextEditor
Modifier and Type | Method and Description |
---|---|
Shape |
getCaretShape(IlvTextSelection.Range range,
IlvTransformer t)
This method returns a
Shape object enveloping the
characters specified by range . |
int |
lineCount()
Returns the line count for multi-line text.
|
int |
lineOffset(int index)
Returns the line offset for a given line.
|
int |
pickCharacter(IlvPoint click,
IlvTransformer t)
Returns the index of the character clicked by the user.
|
getLabel, getLabelBBox, setLabel, supportMultiline
Shape getCaretShape(IlvTextSelection.Range range, IlvTransformer t)
Shape
object enveloping the
characters specified by range
. The returned
Shape
is used to highlight the background behind characters
selected.
If the range has collapsed, that is no characters are selected, the shape used to render the insertion caret is returned.
range
- A Range
indicating the number and position of
selected characters.t
- The transformer used while drawing the graphic object being
edited.Shape
used to highlight the selected characters.
If null
is returned, the text is not editable and the caret
shape should not be displayed.int pickCharacter(IlvPoint click, IlvTransformer t)
click
- The position clicked on with the mouse. The coordinates
have already been transformed by the IlvTransformer
,
t
.t
- The transformer used to draw the label.int lineCount()
1
is returned.lineOffset(int)
int lineOffset(int index)
This method is used for determining the line number for a given character.
Note: the offset of line N + 1
is not always
the offset of line N
plus the number of characters displayed on
line N
.
To improve the label layout, whitespace and control characters are sometimes
omitted in the label seen by the user.
index
- The line index. The first line in the label has index 0.lineCount()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.