/** * Creates a new spelling annotation. * * @param problem the spelling problem. */ public SpellingAnnotation(SpellingProblem problem) { super(TYPE, false, problem.getMessage()); fSpellingProblem= problem; }
/** * Creates a new spelling annotation. * * @param problem the spelling problem. */ public SpellingAnnotation(SpellingProblem problem) { super(TYPE, false, problem.getMessage()); fSpellingProblem= problem; }
/** * Creates a new spelling annotation. * * @param problem the spelling problem. */ public SpellingAnnotation(SpellingProblem problem) { super(TYPE, false, problem.getMessage()); fSpellingProblem= problem; }
public void accept(SpellingProblem problem) { IProblemRequestor requestor= fRequestor; if (requestor != null) { try { int line= getDocument().getLineOfOffset(problem.getOffset()) + 1; String word= getDocument().get(problem.getOffset(), problem.getLength()); boolean dictionaryMatch= false; boolean sentenceStart= false; if (problem instanceof JavaSpellingProblem) { dictionaryMatch= ((JavaSpellingProblem)problem).isDictionaryMatch(); sentenceStart= ((JavaSpellingProblem) problem).isSentenceStart(); } // see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=81514 IEditorInput editorInput= fEditor.getEditorInput(); if (editorInput != null) { CoreSpellingProblem iProblem= new CoreSpellingProblem(problem.getOffset(), problem.getOffset() + problem.getLength() - 1, line, problem.getMessage(), word, dictionaryMatch, sentenceStart, getDocument(), editorInput.getName()); requestor.acceptProblem(iProblem); } } catch (BadLocationException x) { // drop this SpellingProblem } } }
@Override public void accept(SpellingProblem problem) { IProblemRequestor requestor= fRequestor; if (requestor != null) { try { int line= getDocument().getLineOfOffset(problem.getOffset()) + 1; String word= getDocument().get(problem.getOffset(), problem.getLength()); boolean dictionaryMatch= false; boolean sentenceStart= false; if (problem instanceof JavaSpellingProblem) { dictionaryMatch= ((JavaSpellingProblem)problem).isDictionaryMatch(); sentenceStart= ((JavaSpellingProblem) problem).isSentenceStart(); } // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=81514 IEditorInput editorInput= fEditor.getEditorInput(); if (editorInput != null) { CoreSpellingProblem iProblem= new CoreSpellingProblem(problem.getOffset(), problem.getOffset() + problem.getLength() - 1, line, problem.getMessage(), word, dictionaryMatch, sentenceStart, getDocument(), editorInput.getName()); requestor.acceptProblem(iProblem); } } catch (BadLocationException x) { // drop this SpellingProblem } } }
@Override public void accept(SpellingProblem problem) { IProblemRequestor requestor= fRequestor; if (requestor != null) { try { int line= getDocument().getLineOfOffset(problem.getOffset()) + 1; String word= getDocument().get(problem.getOffset(), problem.getLength()); boolean dictionaryMatch= false; boolean sentenceStart= false; if (problem instanceof JavaSpellingProblem) { dictionaryMatch= ((JavaSpellingProblem)problem).isDictionaryMatch(); sentenceStart= ((JavaSpellingProblem) problem).isSentenceStart(); } // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=81514 IEditorInput editorInput= fEditor.getEditorInput(); if (editorInput != null) { CoreSpellingProblem iProblem= new CoreSpellingProblem(problem.getOffset(), problem.getOffset() + problem.getLength() - 1, line, problem.getMessage(), word, dictionaryMatch, sentenceStart, getDocument(), editorInput.getName()); requestor.acceptProblem(iProblem); } } catch (BadLocationException x) { // drop this SpellingProblem } } }