@Override public void uninstall(AbstractThemedScrollBarAdapter abstractThemedScrollBarAdapter, boolean disposing) { super.uninstall(abstractThemedScrollBarAdapter, disposing); fStyledText.removeModifyListener(this); if (fTextContent != null) { fTextContent.removeTextChangeListener(this); fTextContent = null; } this.fAbstractThemedScrollBarAdapter = null; }
void uninstall() { StyledText editorTextWidget = fEditorViewer.getTextWidget(); // untrack changed content of styled text of the editor if (editorTextWidget.getContent() != null) { editorTextWidget.getContent().removeTextChangeListener(this); } // untrack changed styles of styled text of the editor if (fEditorViewer instanceof ITextViewerExtension4) { ((ITextViewerExtension4) fEditorViewer).removeTextPresentationListener(this); } fEditorViewer.removeTextInputListener(this); // track changed of vertical bar scroll to update highlight // Viewport. fEditorViewer.removeViewportListener(this); editorTextWidget.removeControlListener(this); fScaledFonts.values().forEach(Font::dispose); } }
/** * Sets the content implementation to use for text storage. * * @param newContent StyledTextContent implementation to use for text storage. * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ public void setContent(StyledTextContent newContent) { checkWidget(); if (newContent == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } if (content != null) { content.removeTextChangeListener(textChangeListener); } content = newContent; content.addTextChangeListener(textChangeListener); reset(); } /**
/** * Sets the content implementation to use for text storage. * * @param newContent StyledTextContent implementation to use for text storage. * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ public void setContent(StyledTextContent newContent) { checkWidget(); if (newContent == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } if (content != null) { content.removeTextChangeListener(textChangeListener); } content = newContent; content.addTextChangeListener(textChangeListener); reset(); } /**
/** * Sets the content implementation to use for text storage. * * @param newContent StyledTextContent implementation to use for text storage. * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ public void setContent(StyledTextContent newContent) { checkWidget(); if (newContent == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } if (content != null) { content.removeTextChangeListener(textChangeListener); } content = newContent; content.addTextChangeListener(textChangeListener); reset(); } /**
/** * Sets the content implementation to use for text storage. * * @param newContent StyledTextContent implementation to use for text storage. * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ public void setContent(StyledTextContent newContent) { checkWidget(); if (newContent == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } if (content != null) { content.removeTextChangeListener(textChangeListener); } content = newContent; content.addTextChangeListener(textChangeListener); reset(); } /**
/** * Sets the content implementation to use for text storage. * * @param newContent StyledTextContent implementation to use for text storage. * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ public void setContent(StyledTextContent newContent) { checkWidget(); if (newContent == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } if (content != null) { content.removeTextChangeListener(textChangeListener); } content = newContent; content.addTextChangeListener(textChangeListener); reset(); } /**
@Override public void paintControl(GC gc, Rectangle currClientArea, Scrollable scrollable) { // At each paint, check if the content changed and keep the last // max/selection (unfortunately, it doesn't provide a reliable way // to listen such changes, so, we must poll it). if(fScrollBar != null){ fLastMax = fScrollBar.getMaximum(); fLastSelection = fScrollBar.getSelection(); } if (fTextContent != null && fStyledText.getContent() != fTextContent) { fTextContent.removeTextChangeListener(this); fTextContent = fStyledText.getContent(); fTextContent.addTextChangeListener(this); } super.paintControl(gc, currClientArea, scrollable); } }
content.removeTextChangeListener(textChangeListener); content = null;
content.removeTextChangeListener(textChangeListener); content = null;
content.removeTextChangeListener(textChangeListener); content = null;
content.removeTextChangeListener(textChangeListener); content = null;
content.removeTextChangeListener(textChangeListener); content = null;
public void undecorate() { if (boxText == null && !decorated) return; decorated = false; if (boxMouseClick != null) boxText.removeMouseListener(boxMouseClick); boxText.getContent().removeTextChangeListener(boxTextChange); boxText.removeMouseTrackListener(boxMouseTrack); boxText.removeMouseMoveListener(boxMouseMove); boxText.removePaintListener(boxPaint); boxText.removeMouseListener(fillMouseClick); boxText.removeModifyListener(boxModify); boxText.removeKeyListener(boxKey); boxText.setIndent(oldIndent); boxText.setBackgroundImage(null); if (oldBackground != null) boxText.setBackground(new Color(null,oldBackground)); else boxText.setBackground(null); if (settingsChangeListener!=null) settings.removePropertyChangeListener(settingsChangeListener); }