public void apply(IDocument document, char trigger, int offset) { try { String replacement= fString.substring(offset - fOffset); document.replace(offset, 0, replacement); } catch (BadLocationException x) { // TODO Auto-generated catch block x.printStackTrace(); } }
@Override public void apply(IDocument document) { try { document.replace(replacementOffset, replacementLength, replacementString); } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
@Override public void apply(IDocument document, char trigger, int offset) { try { String replacement= fString.substring(offset - fOffset); document.replace(offset, 0, replacement); } catch (BadLocationException x) { // TODO Auto-generated catch block x.printStackTrace(); } }
public void replaceTextRange(int pos, int length, String text) { try { fDocument.replace(pos, length, text); } catch (BadLocationException x) { //TODO Log it x.printStackTrace(); } }
@Override public void apply(IDocument document) { try { document.replace(replacementOffset, replacementLength, replacementString); } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void apply(IDocument document) { TextEdit edits = m_rewriter.rewriteAST(document, null); UndoEdit undo = null; try { undo = edits.apply(document); } catch(MalformedTreeException e) { e.printStackTrace(); } catch(BadLocationException e) { e.printStackTrace(); } }
/** * Apply the given edit on the given string and return the updated string. * Return the given string if anything wrong happen while applying the edit. * * @param original the given string * @param edit the given edit * * @return the updated string */ public final static String editedString(String original, TextEdit edit) { if (edit == null) { return original; } SimpleDocument document = new SimpleDocument(original); try { edit.apply(document, TextEdit.NONE); return document.get(); } catch (MalformedTreeException e) { e.printStackTrace(); } catch (BadLocationException e) { e.printStackTrace(); } return original; }
/** * Apply the given edit on the given string and return the updated string. * Return the given string if anything wrong happen while applying the edit. * * @param original the given string * @param edit the given edit * * @return the updated string */ public final static String editedString(String original, TextEdit edit) { if (edit == null) { return original; } SimpleDocument document = new SimpleDocument(original); try { edit.apply(document, TextEdit.NONE); return document.get(); } catch (MalformedTreeException e) { e.printStackTrace(); } catch (BadLocationException e) { e.printStackTrace(); } return original; }
/** * Apply the given edit on the given string and return the updated string. * Return the given string if anything wrong happen while applying the edit. * * @param original the given string * @param edit the given edit * * @return the updated string */ public final static String editedString(String original, TextEdit edit) { if (edit == null) { return original; } SimpleDocument document = new SimpleDocument(original); try { edit.apply(document, TextEdit.NONE); return document.get(); } catch (MalformedTreeException e) { e.printStackTrace(); } catch (BadLocationException e) { e.printStackTrace(); } return original; }
/** * Apply the given edit on the given string and return the updated string. * Return the given string if anything wrong happen while applying the edit. * * @param original the given string * @param edit the given edit * * @return the updated string */ public final static String editedString(String original, TextEdit edit) { if (edit == null) { return original; } SimpleDocument document = new SimpleDocument(original); try { edit.apply(document, TextEdit.NONE); return document.get(); } catch (MalformedTreeException e) { e.printStackTrace(); } catch (BadLocationException e) { e.printStackTrace(); } return original; }
/** * Apply the given edit on the given string and return the updated string. * Return the given string if anything wrong happen while applying the edit. * * @param original the given string * @param edit the given edit * * @return the updated string */ public final static String editedString(String original, TextEdit edit) { if (edit == null) { return original; } SimpleDocument document = new SimpleDocument(original); try { edit.apply(document, TextEdit.NONE); return document.get(); } catch (MalformedTreeException e) { e.printStackTrace(); } catch (BadLocationException e) { e.printStackTrace(); } return original; }
public IRegion getHoverRegion(ITextViewer textViewer, int offset) { IDocument doc = textViewer.getDocument(); try { int start = offset; int end = offset; while (start >= 0 && isWordChar(doc.getChar(start))) start--; while (end < doc.getLength() && isWordChar(doc.getChar(end))) end++; start++; int length = Math.min(doc.getLength(), end - start); start = Math.max(0,start); return new Region(start, length); } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
/** * Apply the given edit on the given string and return the updated string. * Return the given string if anything wrong happen while applying the edit. * * @param original the given string * @param edit the given edit * * @return the updated string */ public final static String editedString(String original, TextEdit edit) { if (edit == null) { return original; } SimpleDocument document = new SimpleDocument(original); try { edit.apply(document, TextEdit.NONE); return document.get(); } catch (MalformedTreeException e) { e.printStackTrace(); } catch (BadLocationException e) { e.printStackTrace(); } return original; }
public IRegion getHoverRegion(ITextViewer textViewer, int offset) { IDocument doc = textViewer.getDocument(); try { int start = offset; int end = offset; while (start >= 0 && isWordChar(doc.getChar(start))) start--; while (end < doc.getLength() && isWordChar(doc.getChar(end))) end++; start++; int length = Math.min(doc.getLength(), end - start); start = Math.max(0,start); return new Region(start, length); } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
/** * Apply the given edit on the given string and return the updated string. * Return the given string if anything wrong happen while applying the edit. * * @param original the given string * @param edit the given edit * * @return the updated string */ public final static String editedString(String original, TextEdit edit) { if (edit == null) { return original; } SimpleDocument document = new SimpleDocument(original); try { edit.apply(document, TextEdit.NONE); return document.get(); } catch (MalformedTreeException e) { e.printStackTrace(); } catch (BadLocationException e) { e.printStackTrace(); } return original; }
public IRegion match(IDocument document, int offset) { if (document == null || offset < 0) { throw new IllegalArgumentException(); } try { fOffset = offset; fDocument = document; if (!isBrace(fDocument.getChar(offset)) && (offset == 0 || !isBrace(fDocument.getChar(offset - 1)))) { return null; } updatePairs(); if (matchPairsAt() && fStartPos != fEndPos) return new Region(fStartPos, fEndPos - fStartPos + 1); } catch (BadLocationException e) { if (DLTKCore.DEBUG_PARSER) e.printStackTrace(); } return null; }
widgetEndLine= Math.min(visibleEndLine, end(range) - 1); } catch (BadLocationException x) { x.printStackTrace();
} catch (BadLocationException e) { e.printStackTrace();