@Override public ICompilationUnit getCompilationUnit() { IJavaElement element= JavaCore.create(getMarker().getResource()); if (element instanceof ICompilationUnit) { return (ICompilationUnit)element; } return null; }
public ICompilationUnit getCompilationUnit() { IJavaElement element= JavaCore.create(getMarker().getResource()); if (element instanceof ICompilationUnit) { return (ICompilationUnit)element; } return null; }
@Override public ICompilationUnit getCompilationUnit() { IJavaElement element= JavaCore.create(getMarker().getResource()); if (element instanceof ICompilationUnit) { return (ICompilationUnit)element; } return null; }
@Override public String[] getArguments() { IMarker marker= getMarker(); if (marker != null && marker.exists() && isProblem()) return CorrectionEngine.getProblemArguments(marker); return null; }
@Override public String[] getArguments() { IMarker marker= getMarker(); if (marker != null && marker.exists() && isProblem()) return CorrectionEngine.getProblemArguments(marker); return null; }
public String[] getArguments() { IMarker marker= getMarker(); if (marker != null && marker.exists() && isProblem()) return CorrectionEngine.getProblemArguments(marker); return null; }
@Override public int getId() { IMarker marker= getMarker(); if (marker == null || !marker.exists()) return -1; if (isProblem()) return marker.getAttribute(IJavaModelMarker.ID, -1); // if (TASK_ANNOTATION_TYPE.equals(getAnnotationType())) { // try { // if (marker.isSubtypeOf(IJavaModelMarker.TASK_MARKER)) { // return IProblem.Task; // } // } catch (CoreException e) { // JavaPlugin.log(e); // should no happen, we test for marker.exists // } // } return -1; }
public int getId() { IMarker marker= getMarker(); if (marker == null || !marker.exists()) return -1; if (isProblem()) return marker.getAttribute(IJavaModelMarker.ID, -1); // if (TASK_ANNOTATION_TYPE.equals(getAnnotationType())) { // try { // if (marker.isSubtypeOf(IJavaModelMarker.TASK_MARKER)) { // return IProblem.Task; // } // } catch (CoreException e) { // JavaPlugin.log(e); // should no happen, we test for marker.exists // } // } return -1; }
@Override public int getId() { IMarker marker= getMarker(); if (marker == null || !marker.exists()) return -1; if (isProblem()) return marker.getAttribute(IJavaModelMarker.ID, -1); // if (TASK_ANNOTATION_TYPE.equals(getAnnotationType())) { // try { // if (marker.isSubtypeOf(IJavaModelMarker.TASK_MARKER)) { // return IProblem.Task; // } // } catch (CoreException e) { // JavaPlugin.log(e); // should no happen, we test for marker.exists // } // } return -1; }
private static IProblemLocation findProblemLocation(IEditorInput input, IMarker marker) { IAnnotationModel model= JavaPlugin.getDefault().getCompilationUnitDocumentProvider().getAnnotationModel(input); if (model != null) { // open in editor Iterator iter= model.getAnnotationIterator(); while (iter.hasNext()) { Object curr= iter.next(); if (curr instanceof JavaMarkerAnnotation) { JavaMarkerAnnotation annot= (JavaMarkerAnnotation) curr; if (marker.equals(annot.getMarker())) { Position pos= model.getPosition(annot); if (pos != null) { return new ProblemLocation(pos.getOffset(), pos.getLength(), annot); } } } } } else { // not open in editor ICompilationUnit cu= getCompilationUnit(marker); return createFromMarker(marker, cu); } return null; }
private static IProblemLocation findProblemLocation(IEditorInput input, IMarker marker) { IAnnotationModel model= JavaPlugin.getDefault().getCompilationUnitDocumentProvider().getAnnotationModel(input); if (model != null) { // open in editor Iterator<Annotation> iter= model.getAnnotationIterator(); while (iter.hasNext()) { Annotation curr= iter.next(); if (curr instanceof JavaMarkerAnnotation) { JavaMarkerAnnotation annot= (JavaMarkerAnnotation) curr; if (marker.equals(annot.getMarker())) { Position pos= model.getPosition(annot); if (pos != null) { return new ProblemLocation(pos.getOffset(), pos.getLength(), annot); } } } } } else { // not open in editor ICompilationUnit cu= getCompilationUnit(marker); return createFromMarker(marker, cu); } return null; }
public static IProblemLocation findProblemLocation(IEditorInput input, IMarker marker) { if (marker.getResource() instanceof IFolder) { ICompilationUnit cu= getCompilationUnit(marker); return createFromMarker(marker, cu); } IAnnotationModel model= JavaPlugin.getDefault().getCompilationUnitDocumentProvider().getAnnotationModel(input); if (model != null) { // open in editor Iterator<Annotation> iter= model.getAnnotationIterator(); while (iter.hasNext()) { Annotation curr= iter.next(); if (curr instanceof JavaMarkerAnnotation) { JavaMarkerAnnotation annot= (JavaMarkerAnnotation) curr; if (marker.equals(annot.getMarker())) { Position pos= model.getPosition(annot); if (pos != null) { return new ProblemLocation(pos.getOffset(), pos.getLength(), annot); } } } } } else { // not open in editor ICompilationUnit cu= getCompilationUnit(marker); return createFromMarker(marker, cu); } return null; }