/** * Setting the caret offset and updateing the selection if requested * * @param offset * the offset * @param selection * <code>true</code> to update the current selection * @deprecated internal API for now */ @Deprecated public void impl_setCaretOffset(int offset, boolean selection) { if (selection) { caretOffsetProperty().set(offset); if (offset > this.anchor) { setSelectionRange(this.anchor, offset - this.anchor); } else { setSelectionRange(offset, this.anchor - offset); } } else { setCaretOffset(offset); } }
/** * Setting the caret offset and updateing the selection if requested * * @param offset * the offset * @param selection * <code>true</code> to update the current selection * @deprecated internal API for now */ @Deprecated public void impl_setCaretOffset(int offset, boolean selection) { if (selection) { caretOffsetProperty().set(offset); if (offset > this.anchor) { setSelectionRange(this.anchor, offset - this.anchor); } else { setSelectionRange(offset, this.anchor - offset); } } else { setCaretOffset(offset); } }
/** * default implementation for {@link DefaultTextEditActions#SELECT_ALL} */ protected void defaultSelectAll() { int length = getControl().getContent().getCharCount(); getControl().setSelectionRange(0, length); }
getControl().setSelectionRange(selectionOffset - firstLineDelta, selectionLength - removed + firstLineDelta);
getControl().setSelectionRange(selectionOffset + indentLength, selectionLength + added - indentLength);