260 TextHitInfo visiblePosition) {
261 this(source, id, EventQueue.getMostRecentEventTime(), null,
262 0, caret, visiblePosition);
263 }
264
265 /**
266 * Gets the combined committed and composed text.
267 * Characters from index 0 to index <code>getCommittedCharacterCount() - 1</code> are committed
268 * text, the remaining characters are composed text.
269 *
270 * @return the text.
271 * Always null for CARET_POSITION_CHANGED;
272 * may be null for INPUT_METHOD_TEXT_CHANGED if there's no composed or committed text.
273 */
274 public AttributedCharacterIterator getText() {
275 return text;
276 }
277
278 /**
279 * Gets the number of committed characters in the text.
280 */
281 public int getCommittedCharacterCount() {
282 return committedCharacterCount;
283 }
284
285 /**
286 * Gets the caret.
287 * <p>
288 * The offset of the caret is relative to the current
289 * composed text; that is, the composed text within getText()
290 * if this is an <code>INPUT_METHOD_TEXT_CHANGED</code> event,
291 * the composed text within getText() of the
292 * preceding <code>INPUT_METHOD_TEXT_CHANGED</code> event otherwise.
293 *
294 * @return the caret (a.k.a. insertion point).
295 * Null if there's no caret within current composed text.
296 */
297 public TextHitInfo getCaret() {
298 return caret;
299 }
|
260 TextHitInfo visiblePosition) {
261 this(source, id, EventQueue.getMostRecentEventTime(), null,
262 0, caret, visiblePosition);
263 }
264
265 /**
266 * Gets the combined committed and composed text.
267 * Characters from index 0 to index <code>getCommittedCharacterCount() - 1</code> are committed
268 * text, the remaining characters are composed text.
269 *
270 * @return the text.
271 * Always null for CARET_POSITION_CHANGED;
272 * may be null for INPUT_METHOD_TEXT_CHANGED if there's no composed or committed text.
273 */
274 public AttributedCharacterIterator getText() {
275 return text;
276 }
277
278 /**
279 * Gets the number of committed characters in the text.
280 * @return the number of committed characters in the text
281 */
282 public int getCommittedCharacterCount() {
283 return committedCharacterCount;
284 }
285
286 /**
287 * Gets the caret.
288 * <p>
289 * The offset of the caret is relative to the current
290 * composed text; that is, the composed text within getText()
291 * if this is an <code>INPUT_METHOD_TEXT_CHANGED</code> event,
292 * the composed text within getText() of the
293 * preceding <code>INPUT_METHOD_TEXT_CHANGED</code> event otherwise.
294 *
295 * @return the caret (a.k.a. insertion point).
296 * Null if there's no caret within current composed text.
297 */
298 public TextHitInfo getCaret() {
299 return caret;
300 }
|