public Position getPosition(Annotation annotation) { if(delegate != null) { return delegate.getPosition(annotation); } else { return null; } }
@Override public Position getPosition(Annotation annotation) { Position position= fAnnotations.get(annotation); if (position != null) return position; Iterator<IAnnotationModel> it= fAttachments.values().iterator(); while (position == null && it.hasNext()) position= it.next().getPosition(annotation); return position; }
@Override public Position getPosition(Annotation annotation) { Position position= fAnnotations.get(annotation); if (position != null) return position; Iterator<IAnnotationModel> it= fAttachments.values().iterator(); while (position == null && it.hasNext()) position= it.next().getPosition(annotation); return position; }
private Annotation findNext() { while (fParentIterator.hasNext()) { Annotation next= fParentIterator.next(); Position position= fModel.getPosition(next); if (position != null) { int offset= position.getOffset(); if (isWithinRegion(offset, position.getLength())) return next; } } return null; }
private Annotation findNext() { while (fParentIterator.hasNext()) { Annotation next= fParentIterator.next(); Position position= fModel.getPosition(next); if (position != null) { int offset= position.getOffset(); if (isWithinRegion(offset, position.getLength())) return next; } } return null; }
@Override public IRegion getRangeIndication() { if (fRangeIndicator != null && fVisualAnnotationModel != null) { Position position= fVisualAnnotationModel.getPosition(fRangeIndicator); if (position != null) return new Region(position.getOffset(), position.getLength()); } return null; }
@Override public IRegion getRangeIndication() { if (fRangeIndicator != null && fVisualAnnotationModel != null) { Position position= fVisualAnnotationModel.getPosition(fRangeIndicator); if (position != null) return new Region(position.getOffset(), position.getLength()); } return null; }
public IRegion getRangeIndication() { if (this.fRangeIndicator != null && this.fVisualAnnotationModel != null) { Position position= this.fVisualAnnotationModel.getPosition(this.fRangeIndicator); if (position != null) return new Region(position.getOffset(), position.getLength()); } return null; }
private static ProblemLocation getProblemLocation(IJavaAnnotation javaAnnotation, IAnnotationModel model) { int problemId= javaAnnotation.getId(); if (problemId != -1) { Position pos= model.getPosition((Annotation) javaAnnotation); if (pos != null) { return new ProblemLocation(pos.getOffset(), pos.getLength(), javaAnnotation); // java problems all handled by the quick assist processors } } 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; }
public void annotationDefaultSelected(VerticalRulerEvent event) { Annotation a= event.getSelectedAnnotation(); IAnnotationModel model= getAnnotationModel(); Position position= model.getPosition(a); if (position == null) return; getTextEditor().selectAndReveal(position.offset, position.length); }
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 static ProblemLocation getProblemLocation(IJavaAnnotation javaAnnotation, IAnnotationModel model) { int problemId= javaAnnotation.getId(); if (problemId != -1) { Position pos= model.getPosition((Annotation) javaAnnotation); if (pos != null) { return new ProblemLocation(pos.getOffset(), pos.getLength(), javaAnnotation); // java problems all handled by the quick assist processors } } return null; }
private static ProblemLocation getProblemLocation(IJavaAnnotation javaAnnotation, IAnnotationModel model) { int problemId= javaAnnotation.getId(); if (problemId != -1) { Position pos= model.getPosition((Annotation) javaAnnotation); if (pos != null) { return new ProblemLocation(pos.getOffset(), pos.getLength(), javaAnnotation); // java problems all handled by the quick assist processors } } return null; }
@Override public void annotationDefaultSelected(VerticalRulerEvent event) { Annotation a= event.getSelectedAnnotation(); IAnnotationModel model= getAnnotationModel(); Position position= model.getPosition(a); if (position == null) return; getTextEditor().selectAndReveal(position.offset, position.length); }
@Override public void annotationDefaultSelected(VerticalRulerEvent event) { Annotation a= event.getSelectedAnnotation(); IAnnotationModel model= getAnnotationModel(); Position position= model.getPosition(a); if (position == null) return; getTextEditor().selectAndReveal(position.offset, position.length); }
protected IHyperlink createHyperlink(ISourceViewer viewer, IAnnotationModel annotationModel, AnchorHrefAnnotation anchorHrefAnnotation) { Position position = annotationModel.getPosition(anchorHrefAnnotation); IRegion region = new Region(position.getOffset(), position.getLength()); String href = anchorHrefAnnotation.getAnchorHref(); if (href != null && href.startsWith("#")) { //$NON-NLS-1$ return new DocumentHyperlink(viewer, region, href); } else { return createUrlHyperlink(region, href); } }
private static ProblemLocation getProblemLocation(IJavaAnnotation javaAnnotation, IAnnotationModel model) { int problemId= javaAnnotation.getId(); if (problemId != -1) { Position pos= model.getPosition((Annotation) javaAnnotation); if (pos != null) { return new ProblemLocation(pos.getOffset(), pos.getLength(), javaAnnotation); // java problems all handled by the quick assist processors } } return null; }
@Override protected Region getHoverRegionInternal(final int lineNumber, final int offset) { List<Annotation> annotations = getAnnotations(lineNumber, offset); for (Annotation annotation : annotations) { Position position = sourceViewer.getAnnotationModel().getPosition(annotation); if (position != null) { final int start = position.getOffset(); return new Region (start, position.getLength()); } } return null; }