private static boolean isProblemMarkerAnnotation(Annotation annotation) { if (!(annotation instanceof MarkerAnnotation)) return false; try { return(((MarkerAnnotation)annotation).getMarker().isSubtypeOf(IMarker.PROBLEM)); } catch (CoreException e) { return false; } }
private static boolean isProblemMarkerAnnotation(Annotation annotation) { if (!(annotation instanceof MarkerAnnotation)) return false; try { return(((MarkerAnnotation)annotation).getMarker().isSubtypeOf(IMarker.PROBLEM)); } catch (CoreException e) { return false; } }
private boolean isProblemMarkerAnnotation(final Annotation annotation) { if (!(annotation instanceof MarkerAnnotation)) return false; try { return (((MarkerAnnotation) annotation).getMarker().isSubtypeOf(IMarker.PROBLEM)); } catch (final CoreException e) { return false; } }
/** * Tells whether the given annotation stands for a problem marker. * * @param annotation the annotation * @return <code>true</code> if it is a problem marker * @since 3.4 */ private static boolean isProblemMarkerAnnotation(Annotation annotation) { if (!(annotation instanceof MarkerAnnotation)) return false; try { return(((MarkerAnnotation)annotation).getMarker().isSubtypeOf(IMarker.PROBLEM)); } catch (CoreException e) { return false; } }
/** * Tells whether the given annotation stands for a problem marker. * * @param annotation the annotation * @return <code>true</code> if it is a problem marker * @since 3.4 */ private static boolean isProblemMarkerAnnotation(Annotation annotation) { if (!(annotation instanceof MarkerAnnotation)) return false; try { return(((MarkerAnnotation)annotation).getMarker().isSubtypeOf(IMarker.PROBLEM)); } catch (CoreException e) { return false; } }
public static boolean hasCorrections(Annotation annotation) { if (annotation instanceof MarkerAnnotation) { MarkerAnnotation mAnnot = (MarkerAnnotation) annotation; IMarker marker = mAnnot.getMarker(); return isFixable(marker); } else if (annotation instanceof IScriptAnnotation) { return isFixable((IScriptAnnotation) annotation); } return false; } }
public String getCode(Annotation annotation) { if (annotation instanceof MarkerAnnotation) { MarkerAnnotation ma = (MarkerAnnotation) annotation; return getCode(ma.getMarker()); } if (annotation instanceof XtextAnnotation) { XtextAnnotation xa = (XtextAnnotation) annotation; return xa.getIssueCode(); } return null; }
public String[] getIssueData(Annotation annotation) { if (annotation instanceof MarkerAnnotation) { MarkerAnnotation ma = (MarkerAnnotation) annotation; return getIssueData(ma.getMarker()); } if (annotation instanceof XtextAnnotation) { XtextAnnotation xa = (XtextAnnotation) annotation; return xa.getIssueData(); } return null; }
public Issue getIssueFromAnnotation(Annotation annotation) { if (annotation instanceof XtextAnnotation) { XtextAnnotation xtextAnnotation = (XtextAnnotation) annotation; return xtextAnnotation.getIssue(); } else if(annotation instanceof MarkerAnnotation) { MarkerAnnotation markerAnnotation = (MarkerAnnotation)annotation; return createIssue(markerAnnotation.getMarker()); } else return null; }
public URI getUriToProblem(Annotation annotation) { if (annotation instanceof MarkerAnnotation) { MarkerAnnotation ma = (MarkerAnnotation) annotation; return getUriToProblem(ma.getMarker()); } if (annotation instanceof XtextAnnotation) { XtextAnnotation xa = (XtextAnnotation) annotation; return xa.getUriToProblem(); } return null; }
protected List<IMarker> getMarkersFor(ISourceViewer sourceViewer, int lineOffset, int lineLength) { List<IMarker> result = new ArrayList<>(); IAnnotationModel annotationModel = sourceViewer.getAnnotationModel(); Iterator annotationIter = annotationModel.getAnnotationIterator(); while (annotationIter.hasNext()) { Object annotation = annotationIter.next(); if (annotation instanceof MarkerAnnotation) { MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation; IMarker marker = markerAnnotation.getMarker(); Position markerPosition = annotationModel.getPosition(markerAnnotation); if (markerPosition != null && markerPosition.overlapsWith(lineOffset, lineLength)) { result.add(marker); } } } return result; }
private IMarker isAnnotationInRange(IAnnotationModel model, Annotation annot, ISourceReference sourceElement) throws CoreException { if (annot instanceof MarkerAnnotation) { if (sourceElement == null || isInside(model.getPosition(annot), sourceElement)) { IMarker marker= ((MarkerAnnotation) annot).getMarker(); if (marker.exists() && marker.isSubtypeOf(IMarker.PROBLEM)) { return marker; } } } return null; }
private IMarker isAnnotationInRange(IAnnotationModel model, Annotation annot, ISourceReference sourceElement) throws CoreException { if (annot instanceof MarkerAnnotation) { if (sourceElement == null || isInside(model.getPosition(annot), sourceElement)) { IMarker marker= ((MarkerAnnotation) annot).getMarker(); if (marker.exists() && marker.isSubtypeOf(IMarker.PROBLEM)) { return marker; } } } return null; }
private IMarker isAnnotationInRange(IAnnotationModel model, Annotation annot, ISourceReference sourceElement) throws CoreException { if (annot instanceof MarkerAnnotation) { if (sourceElement == null || isInside(model.getPosition(annot), sourceElement)) { IMarker marker= ((MarkerAnnotation) annot).getMarker(); if (marker.exists() && marker.isSubtypeOf(IMarker.PROBLEM)) { return marker; } } } return null; }
private void testIfProblemMarker(Annotation annotation) { if (fIncludesProblemMarkerAnnotations) { return; } if (annotation instanceof JavaMarkerAnnotation) { fIncludesProblemMarkerAnnotations= ((JavaMarkerAnnotation) annotation).isProblem(); } else if (annotation instanceof MarkerAnnotation) { try { IMarker marker= ((MarkerAnnotation) annotation).getMarker(); if (!marker.exists() || marker.isSubtypeOf(IMarker.PROBLEM)) { fIncludesProblemMarkerAnnotations= true; } } catch (CoreException e) { JavaPlugin.log(e); } } }
private void testIfProblemMarker(Annotation annotation) { if (fIncludesProblemMarkerAnnotations) { return; } if (annotation instanceof JavaMarkerAnnotation) { fIncludesProblemMarkerAnnotations= ((JavaMarkerAnnotation) annotation).isProblem(); } else if (annotation instanceof MarkerAnnotation) { try { IMarker marker= ((MarkerAnnotation) annotation).getMarker(); if (!marker.exists() || marker.isSubtypeOf(IMarker.PROBLEM)) { fIncludesProblemMarkerAnnotations= true; } } catch (CoreException e) { JavaPlugin.log(e); } } }
private void testIfProblemMarker(Annotation annotation) { if (fIncludesProblemMarkerAnnotations) { return; } if (annotation instanceof JavaMarkerAnnotation) { fIncludesProblemMarkerAnnotations= ((JavaMarkerAnnotation) annotation).isProblem(); } else if (annotation instanceof MarkerAnnotation) { try { IMarker marker= ((MarkerAnnotation) annotation).getMarker(); if (!marker.exists() || marker.isSubtypeOf(IMarker.PROBLEM)) { fIncludesProblemMarkerAnnotations= true; } } catch (CoreException e) { JavaPlugin.log(e); } } }
@Override public boolean canFix(Annotation annotation) { if (annotation.isMarkedDeleted()) { return false; } if (annotation instanceof MarkerAnnotation) { MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation; if (!markerAnnotation.isQuickFixableStateSet()) { markerAnnotation.setQuickFixable(quickFixer.hasResolutions(markerAnnotation.getMarker())); } return markerAnnotation.isQuickFixable(); } return false; }
@Override public Image getManagedImage(Annotation annotation) { if (annotation instanceof MarkerAnnotation) { IMarker marker = ((MarkerAnnotation)annotation).getMarker(); if (marker != null) { IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker); if (breakpoint != null) { return DebugUIPlugin.getModelPresentation().getImage(breakpoint); } } } return null; } /* (non-Javadoc)
private IMarker isAnnotationInRange(IAnnotationModel model, Annotation annot, Node node, IDocument document, String markerType) throws CoreException { if (annot instanceof MarkerAnnotation) { IMarker marker = ((MarkerAnnotation) annot).getMarker(); if (marker.exists() && marker.isSubtypeOf(markerType)) { Position pos = model.getPosition(annot); if (pos != null && (node == null || isInside(pos.getOffset(), node, document))) { return marker; } } } return null; }