/** * {@inheritDoc} * <p> * This is a performance optimization to reduce the computation of * the text presentation triggered by {@link #setVisibleDocument(IDocument)} * </p> * @see #prepareDelayedProjection() * @since 3.1 */ protected void setVisibleDocument(IDocument document) { if (fIsSetVisibleDocumentDelayed) { fIsSetVisibleDocumentDelayed= false; IDocument previous= getVisibleDocument(); enableProjection(); // will set the visible document if anything is folded IDocument current= getVisibleDocument(); // if the visible document was not replaced, continue as usual if (current != null && current != previous) return; } super.setVisibleDocument(document); }
/** * {@inheritDoc} * <p> * This is a performance optimization to reduce the computation of * the text presentation triggered by {@link #setVisibleDocument(IDocument)} * </p> * @see #prepareDelayedProjection() * @since 3.1 */ @Override protected void setVisibleDocument(IDocument document) { if (fIsSetVisibleDocumentDelayed) { fIsSetVisibleDocumentDelayed= false; IDocument previous= getVisibleDocument(); enableProjection(); // will set the visible document if anything is folded IDocument current= getVisibleDocument(); // if the visible document was not replaced, continue as usual if (current != null && current != previous) return; } super.setVisibleDocument(document); }
/** * {@inheritDoc} * <p> * This is a performance optimization to reduce the computation of * the text presentation triggered by {@link #setVisibleDocument(IDocument)} * </p> * @see #prepareDelayedProjection() * @since 3.1 */ @Override protected void setVisibleDocument(IDocument document) { if (fIsSetVisibleDocumentDelayed) { fIsSetVisibleDocumentDelayed= false; IDocument previous= getVisibleDocument(); enableProjection(); // will set the visible document if anything is folded IDocument current= getVisibleDocument(); // if the visible document was not replaced, continue as usual if (current != null && current != previous) return; } super.setVisibleDocument(document); }
private void executeReplaceVisibleDocument(IDocument visibleDocument) { StyledText textWidget= getTextWidget(); try { if (textWidget != null && !textWidget.isDisposed()) textWidget.setRedraw(false); int topIndex= getTopIndex(); Point selection= getSelectedRange(); setVisibleDocument(visibleDocument); Point currentSelection= getSelectedRange(); if (currentSelection.x != selection.x || currentSelection.y != selection.y) setSelectedRange(selection.x, selection.y); setTopIndex(topIndex); } finally { if (textWidget != null && !textWidget.isDisposed()) textWidget.setRedraw(true); } }
private void executeReplaceVisibleDocument(IDocument visibleDocument) { StyledText textWidget= getTextWidget(); try { if (textWidget != null && !textWidget.isDisposed()) textWidget.setRedraw(false); int topIndex= getTopIndex(); Point selection= getSelectedRange(); setVisibleDocument(visibleDocument); Point currentSelection= getSelectedRange(); if (currentSelection.x != selection.x || currentSelection.y != selection.y) setSelectedRange(selection.x, selection.y); setTopIndex(topIndex); } finally { if (textWidget != null && !textWidget.isDisposed()) textWidget.setRedraw(true); } }