return false; MarkerUtilities.setMessage(attributes, label); return true;
/** * Returns the attributes with which a newly created marker will be initialized. * * @return the initial marker attributes */ private Map<String, Object> getMarkerAttributes(IProblem problem) { Map<String, Object> attributes = new HashMap<>(11); int severity = IMarker.SEVERITY_ERROR; if (problem.isWarning()) { severity = IMarker.SEVERITY_WARNING; } // marker line numbers are 1-based MarkerUtilities.setMessage(attributes, problem.getUnmodifiedMessage()); MarkerUtilities.setLineNumber(attributes, problem.getLineNumber()); MarkerUtilities.setCharStart(attributes, problem.getOffset()); MarkerUtilities.setCharEnd(attributes, problem.getOffset() + problem.getLength()); attributes.put(IMarker.SEVERITY, Integer.valueOf(severity)); return attributes; }
return false; MarkerUtilities.setMessage(attributes, label); return true;
/** * 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; }
/** * 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 the new marker will be initialized with. * <p> * Subclasses may extend or replace this method.</p> * * @return the attributes the new marker will be initialized with */ protected Map<String, Object> getInitialAttributes() { Map<String, Object> attributes= new HashMap<>(11); ITextSelection selection= (ITextSelection) getTextEditor().getSelectionProvider().getSelection(); if (!selection.isEmpty()) { int start= selection.getOffset(); int length= selection.getLength(); if (length < 0) { length= -length; start -= length; } MarkerUtilities.setCharStart(attributes, start); MarkerUtilities.setCharEnd(attributes, start + length); // marker line numbers are 1-based int line= selection.getStartLine(); MarkerUtilities.setLineNumber(attributes, line == -1 ? -1 : line + 1); IDocument document= getTextEditor().getDocumentProvider().getDocument(getTextEditor().getEditorInput()); MarkerUtilities.setMessage(attributes, getLabelProposal(document, start, length)); } return attributes; }
/** * Returns the attributes the new marker will be initialized with. * <p> * Subclasses may extend or replace this method.</p> * * @return the attributes the new marker will be initialized with */ protected Map getInitialAttributes() { Map attributes= new HashMap(11); ITextSelection selection= (ITextSelection) getTextEditor().getSelectionProvider().getSelection(); if (!selection.isEmpty()) { int start= selection.getOffset(); int length= selection.getLength(); if (length < 0) { length= -length; start -= length; } MarkerUtilities.setCharStart(attributes, start); MarkerUtilities.setCharEnd(attributes, start + length); // marker line numbers are 1-based int line= selection.getStartLine(); MarkerUtilities.setLineNumber(attributes, line == -1 ? -1 : line + 1); IDocument document= getTextEditor().getDocumentProvider().getDocument(getTextEditor().getEditorInput()); MarkerUtilities.setMessage(attributes, getLabelProposal(document, start, length)); } return attributes; }