public void apply(IDocument document) { try { document.replace(fReplacementOffset, fReplacementLength, fReplacementString); } catch (BadLocationException x) { // ignore } }
@Override public void apply(IDocument document) { try { document.replace(fReplacementOffset, fReplacementLength, fReplacementString); } catch (BadLocationException x) { // ignore } }
public void apply(IDocument document) { try { document.replace(offset, replacementLength, proposalText); } catch (BadLocationException x) { // ignore } }
@Override public void apply(IDocument document) { try { document.replace(fReplacementOffset, fReplacementLength, fReplacementString); } catch (BadLocationException x) { // ignore } }
@Override public void replace(int position, int length, String text) { try { fDocument.replace(position, length, text); } catch (BadLocationException e) { throw new IndexOutOfBoundsException(e.getMessage()); } }
@Override public void replaceTextRange(int pos, int length, String text) { try { fDocument.replace(pos, length, text); } catch (BadLocationException x) { SWT.error(SWT.ERROR_INVALID_ARGUMENT); } }
/** * Re-applies the change described by this change. */ protected void redoTextChange() { try { if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) ((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp); else fDocumentUndoManager.fDocument.replace(fStart, fEnd - fStart, fText); } catch (BadLocationException x) { } }
private void updateDocument(IDocument document, IStreamContentAccessor sa) throws InvocationTargetException { try { String text= Utilities.readString(sa); document.replace(0, document.getLength(), text); } catch (CoreException e) { throw new InvocationTargetException(e); } catch (BadLocationException e) { throw new InvocationTargetException(e); } }
@Override public void append(String text) { try { fDocument.replace(fDocument.getLength(), 0, text); } catch (BadLocationException e) { throw new IndexOutOfBoundsException(e.getMessage()); } }
private void trimStart(IDocument document) throws BadLocationException { int i= 0; while ((i != document.getLength()) && Character.isWhitespace(document.getChar(i))) i++; document.replace(0, i, ""); //$NON-NLS-1$ }
@Override public void apply(IDocument document) { try { document.replace(fReplacementPosition.getOffset(), fReplacementPosition.getLength(), fReplacementString); } catch (BadLocationException x) { // ignore } }
@Override public void apply(IDocument document) { try { document.replace(fReplacementPosition.getOffset(), fReplacementPosition.getLength(), fReplacementString); } catch (BadLocationException x) { // ignore } }
@Override int performDocumentUpdating(IDocument document) throws BadLocationException { document.replace(getOffset(), getLength(), ""); //$NON-NLS-1$ fDelta= -getLength(); return fDelta; }
@Override int performDocumentUpdating(IDocument document) throws BadLocationException { document.replace(getOffset(), getLength(), ""); //$NON-NLS-1$ fDelta= -getLength(); return fDelta; }
private void convertLineDelimiters(IDocument document) throws BadLocationException { int lines= document.getNumberOfLines(); for (int line= 0; line < lines; line++) { IRegion region= document.getLineInformation(line); String lineDelimiter= document.getLineDelimiter(line); if (lineDelimiter != null) document.replace(region.getOffset() + region.getLength(), lineDelimiter.length(), fLineDelimiter); } }
/** * Executes the edition on document. The offset is taken from the position. * * @throws BadLocationException if the execution of the document fails. */ public void perform() throws BadLocationException { getDocument().replace(getOffset(), getLength(), getText()); }
private void add(String s, DocumentRangeNode parent, DocumentRangeNode child) { Position p= findCorrespondingPosition(parent, child); if (p != null) { try { fBaseDocument.replace(p.getOffset(), p.getLength(), s); } catch (BadLocationException ex) { CompareUIPlugin.log(ex); } } }
private void add(String s, DocumentRangeNode parent, DocumentRangeNode child) { Position p= findCorrespondingPosition(parent, child); if (p != null) { try { fBaseDocument.replace(p.getOffset(), p.getLength(), s); } catch (BadLocationException ex) { CompareUIPlugin.log(ex); } } }
@Override public void replace(int offset, int length, String text) { fReusableRegion.update(offset, length); try { IRegion masterRegion= fMapping.toOriginRegion(fReusableRegion); fMasterDocument.replace(masterRegion.getOffset(), masterRegion.getLength(), text); } catch (BadLocationException e) { internalError(); } }
@Override public void set(String contents) { IRegion masterRegion= fMapping.getCoverage(); if (masterRegion == null) internalError(); try { fMasterDocument.replace(masterRegion.getOffset(), masterRegion.getLength(), contents); } catch (BadLocationException e) { internalError(); } }