/** * Set the current caret offset * * @param offset * the new offset */ public void setCaretOffset(int offset) { this.anchor = offset; caretOffsetProperty().set(offset); clearSelection(); }
/** * Set the current caret offset * * @param offset * the new offset */ public void setCaretOffset(int offset) { this.anchor = offset; caretOffsetProperty().set(offset); clearSelection(); }
void handleTextChanged(TextChangedEvent xxx) { if (this.changingEvent == null) { // full text change int newCharCount = getCharCount(); if (this.caretOffsetProperty.get() > newCharCount) { this.caretOffsetProperty.set(newCharCount); } // in SWT this is done in reset() clearSelection(); // if( getSkin() instanceof StyledTextSkin ) { // ((StyledTextSkin)getSkin()).computeModel(); // } } else { // partial text change // TextChangingEvent event = this.changingEvent; this.changingEvent = null; // if (getSkin() instanceof StyledTextSkin) { // ((StyledTextSkin) getSkin()).computeModelDelta(event); // } } }
void handleTextSet(TextChangedEvent event) { int newCharCount = getCharCount(); if( this.caretOffsetProperty.get() > newCharCount ) { this.caretOffsetProperty.set(newCharCount); } // in SWT this is done in reset() clearSelection(); if( getSkin() instanceof StyledTextSkin ) { ((StyledTextSkin)getSkin()).recalculateItems(); } }