@Override public void unmanagePosition(Position position) { try { fDocument.removePosition(fCategory, position); } catch (BadPositionCategoryException x) { // should not happen } } }
/** * Uninstalls this range. * @see #install() */ public void uninstall() { // http://bugs.eclipse.org/bugs/show_bug.cgi?id=19612 IDocument document= TextViewer.this.getDocument(); if (document != null) { document.removePositionUpdater(this); document.removePosition(fPosition); } if (fTextWidget != null && !fTextWidget.isDisposed()) fTextWidget.removeLineBackgroundListener(this); TextViewer.this.removeTextListener(this); clear(); }
public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { if (oldInput != null && fLocalLastEditPosition != null) { oldInput.removePosition(fLocalLastEditPosition); fLocalLastEditPosition= null; } }
/** * Uninstalls this range. * @see #install() */ public void uninstall() { // http://bugs.eclipse.org/bugs/show_bug.cgi?id=19612 IDocument document= TextViewer.this.getDocument(); if (document != null) { document.removePositionUpdater(this); document.removePosition(fPosition); } if (fTextWidget != null && !fTextWidget.isDisposed()) fTextWidget.removeLineBackgroundListener(this); TextViewer.this.removeTextListener(this); clear(); }
@Override public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { if (oldInput != null && fLocalLastEditPosition != null) { oldInput.removePosition(fLocalLastEditPosition); fLocalLastEditPosition= null; } }
@Override public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { if (oldInput != null && fLocalLastEditPosition != null) { oldInput.removePosition(fLocalLastEditPosition); fLocalLastEditPosition= null; } }
@Override public void unmanagePosition(Position position) { try { fDocument.removePosition(fCategory, position); } catch (BadPositionCategoryException x) { // should not happen } } }
/** * Removes the given position from the default position category of the * given document. * * @param document the document to which to add the position * @param position the position to add * * @since 3.0 */ protected void removePosition(IDocument document, Position position) { if (document != null) document.removePosition(position); }
/** * Removes the given position from the default position category of the * given document. * * @param document the document to which to add the position * @param position the position to add * * @since 3.0 */ protected void removePosition(IDocument document, Position position) { if (document != null) document.removePosition(position); }
/** * Empties the collector. */ public void reset() { fProposals.clear(); for (Iterator<Entry<IDocument, Position>> it= fPositions.entrySet().iterator(); it.hasNext();) { Entry<IDocument, Position> entry= it.next(); IDocument doc= entry.getKey(); Position position= entry.getValue(); doc.removePosition(position); } fPositions.clear(); }
/** * Empties the collector. */ public void reset() { fProposals.clear(); for (Iterator<Entry<IDocument, Position>> it= fPositions.entrySet().iterator(); it.hasNext();) { Entry<IDocument, Position> entry= it.next(); IDocument doc= entry.getKey(); Position position= entry.getValue(); doc.removePosition(position); } fPositions.clear(); }
/** * Empties the collector. */ public void reset() { fProposals.clear(); for (Iterator it= fPositions.entrySet().iterator(); it.hasNext();) { Entry entry= (Entry) it.next(); IDocument doc= (IDocument) entry.getKey(); Position position= (Position) entry.getValue(); doc.removePosition(position); } fPositions.clear(); }
@Override public void documentChanged(DocumentEvent e) { if (fCachedRedrawState) { try { e.getDocument().removePosition(fPositionCategory, fRememberedPosition); } catch (BadPositionCategoryException x) { // can not happen on input documents } } fDocumentChanging= false; }
@Override public void documentChanged(DocumentEvent e) { if (fCachedRedrawState) { try { e.getDocument().removePosition(fPositionCategory, fRememberedPosition); } catch (BadPositionCategoryException x) { // can not happen on input documents } } fDocumentChanging= false; }
public void documentChanged(DocumentEvent e) { if (fCachedRedrawState) { try { e.getDocument().removePosition(fPositionCategory, fRememberedPosition); } catch (BadPositionCategoryException x) { // can not happen on input documents } } fDocumentChanging= false; }
private void untrackPosition(ITextFileBuffer fb, Match match) { Position position= (Position) fMatchesToPositions.get(match); if (position != null) { removeFileBufferMapping(fb, match); fMatchesToSearchResults.remove(match); fMatchesToPositions.remove(match); fb.getDocument().removePosition(position); } }
private void untrackPosition(ITextFileBuffer fb, Match match) { Position position= fMatchesToPositions.get(match); if (position != null) { removeFileBufferMapping(fb, match); fMatchesToSearchResults.remove(match); fMatchesToPositions.remove(match); fb.getDocument().removePosition(position); } }
/** * Removes the affected positions from their categories to avoid * that they are invalidly updated. * * @param document the document */ private void removeAffectedPositions(IDocument document) { int size= fOverlappingPositionReferences.size(); for (int i= 0; i < size; i++) { PositionReference r= fOverlappingPositionReferences.get(i); try { document.removePosition(r.getCategory(), r.getPosition()); } catch (BadPositionCategoryException x) { // can not happen } } }
public void clearFileLink() { try { Position[] positions = getDocument().getPositions(CppStyleMessageConsole.ERROR_MARKER_CATEGORY); for (Position position : positions) { getDocument().removePosition(CppStyleMessageConsole.ERROR_MARKER_CATEGORY, position); } } catch (BadPositionCategoryException e) { CppStyle.log(e); } } }
@Override public void documentChanged(DocumentEvent event) { if (fRememberedPosition != null) { if (!fRememberedPosition.isDeleted()) { event.getDocument().removePosition(fRememberedPosition); fActiveRegion= new Region(fRememberedPosition.getOffset(), fRememberedPosition.getLength()); } else { fActiveRegion= new Region(event.getOffset(), event.getLength()); } fRememberedPosition= null; StyledText widget= fTextViewer.getTextWidget(); if (widget != null && !widget.isDisposed()) { widget.getDisplay().asyncExec(() -> hideHyperlinks()); } } }