public void replaceTextRange(int start, int length, String newText) { newText = newText == null ? "" : newText; notifyListeners(makeTextChangingEvent(start, length, newText)); delete(start, start+length); insert(start, newText); notifyListeners(new TextChangedEvent(this)); }
public void setText(String newText) { delete(0, size()); insert(0, newText); TextChangedEvent evt = new TextChangedEvent(this); for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) { ((TextChangeListener) iter.next()).textSet(evt); } }
private void notifyListeners(TextChangedEvent changedEvent) { for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) { TextChangeListener element = (TextChangeListener) iter.next(); element.textChanged(changedEvent); } }
/************************************************************************** * Fire a text-set event *************************************************************************/ private void fireTextSet() { for (TextChangeListener lst : m_listeners) { lst.textSet(new TextChangedEvent(this)); } }
/************************************************************************** * Fire a text-moved event *************************************************************************/ private void fireTextMoved() { for (TextChangeListener lst : m_listeners) { lst.textSet(new TextChangedEvent(this)); } }
/** * @see org.eclipse.swt.custom.StyledTextContent#replaceTextRange(int, int, java.lang.String) */ public void replaceTextRange(int start, int length, String newText) { newText = newText == null ? "" : newText; notifyListeners(makeTextChangingEvent(start, length, newText)); delete(start, length); insert(start, newText); notifyListeners(new TextChangedEvent(this)); }
/** * @see org.eclipse.swt.custom.StyledTextContent#setText(java.lang.String) */ public void setText(String newText) { delete(0, size()); insert(0, newText); TextChangedEvent evt = new TextChangedEvent(this); for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) { ((TextChangeListener) iter.next()).textSet(evt); } }
/** * @param changedEvent */ private void notifyListeners(TextChangedEvent changedEvent) { for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) { TextChangeListener element = (TextChangeListener) iter.next(); element.textChanged(changedEvent); } }
public void replaceTextRange(int start, int length, String newText) { newText = newText == null ? "" : newText; notifyListeners(makeTextChangingEvent(start, length, newText)); delete(start, length); insert(start, newText); notifyListeners(new TextChangedEvent(this)); }
@Override public void replaceTextRange(final int inStart, final int inReplaceLength, final String inText) { if (!isValidReplace(inStart, inReplaceLength)) SWT.error(SWT.ERROR_INVALID_ARGUMENT); // inform listeners final TextChangingEvent lChanging = new TextChangingEvent(this); lChanging.start = inStart; lChanging.replaceLineCount = lineCount(inStart, inReplaceLength); lChanging.newText = inText; lChanging.newLineCount = lineCount(inText); lChanging.replaceCharCount = inReplaceLength; lChanging.newCharCount = inText.length(); final Object[] lListeners = listeners.getListeners(); for (int i = 0; i < lListeners.length; ++i) { ((TextChangeListener) lListeners[i]).textChanging(lChanging); } delete(inStart, inReplaceLength, lChanging.replaceLineCount + 1); insert(inStart, inText); // inform listeners again for (int i = 0; i < lListeners.length; ++i) { ((TextChangeListener) lListeners[i]) .textChanged(new TextChangedEvent(this)); } }
@Override public void setText(final String inText) { textStore = inText.toCharArray(); gapStart = -1; gapEnd = -1; expandExp = 1; indexLines(); final Object[] lListeners = listeners.getListeners(); for (int i = 0; i < lListeners.length; ++i) { ((TextChangeListener) lListeners[i]).textSet(new TextChangedEvent( this)); } }
@Override public void textChanged(final TextChangedEvent event) { change(); }
@Override public void textSet(final TextChangedEvent event) { change(); }
@Override public void textChanged(TextChangedEvent event) { this.currClientArea = null; //will force redrawing everything askFullRedraw = true; }
@Override public void textSet(TextChangedEvent event) { this.currClientArea = null; //will force redrawing everything askFullRedraw = true; }