/** * Returns the attributes with which a newly created marker will be * initialized. * * @return the initial marker attributes */ protected Map<String, Object> getInitialAttributes() { Map<String, Object> attributes= new HashMap<>(11); IDocumentProvider provider= fTextEditor.getDocumentProvider(); IDocument document= provider.getDocument(fTextEditor.getEditorInput()); int line= fRuler.getLineOfLastMouseButtonActivity(); int start= -1; int end= -1; int length= 0; try { IRegion lineInformation= document.getLineInformation(line); start= lineInformation.getOffset(); length= lineInformation.getLength(); end= start + length; } catch (BadLocationException x) { } // marker line numbers are 1-based MarkerUtilities.setMessage(attributes, getLabelProposal(document, start, length)); MarkerUtilities.setLineNumber(attributes, line + 1); MarkerUtilities.setCharStart(attributes, start); MarkerUtilities.setCharEnd(attributes, end); return attributes; }
/** * Returns the attributes with which a newly created marker will be * initialized. * * @return the initial marker attributes */ protected Map getInitialAttributes() { Map attributes= new HashMap(11); IDocumentProvider provider= fTextEditor.getDocumentProvider(); IDocument document= provider.getDocument(fTextEditor.getEditorInput()); int line= fRuler.getLineOfLastMouseButtonActivity(); int start= -1; int end= -1; int length= 0; try { IRegion lineInformation= document.getLineInformation(line); start= lineInformation.getOffset(); length= lineInformation.getLength(); end= start + length; } catch (BadLocationException x) { } // marker line numbers are 1-based MarkerUtilities.setMessage(attributes, getLabelProposal(document, start, length)); MarkerUtilities.setLineNumber(attributes, line + 1); MarkerUtilities.setCharStart(attributes, start); MarkerUtilities.setCharEnd(attributes, end); return attributes; }