use of org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel in project webtools.sourceediting by eclipse.
the class BreakpointRulerAction method hasMarkers.
protected boolean hasMarkers() {
IResource resource = getResource();
IDocument document = getDocument();
AbstractMarkerAnnotationModel model = getAnnotationModel();
if (resource != null && model != null && resource.exists()) {
try {
IMarker[] allMarkers = resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
if (allMarkers != null) {
for (int i = 0; i < allMarkers.length; i++) {
if (includesRulerLine(model.getMarkerPosition(allMarkers[i]), document)) {
return true;
}
}
}
} catch (CoreException x) {
//
}
}
return false;
}
use of org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel in project webtools.sourceediting by eclipse.
the class BreakpointRulerAction method getAnnotationModel.
/**
* Returns the <code>AbstractMarkerAnnotationModel</code> of the
* editor's input.
*
* @return the marker annotation model
*/
protected AbstractMarkerAnnotationModel getAnnotationModel() {
IDocumentProvider provider = fTextEditor.getDocumentProvider();
IAnnotationModel model = provider.getAnnotationModel(fTextEditor.getEditorInput());
if (model instanceof AbstractMarkerAnnotationModel)
return (AbstractMarkerAnnotationModel) model;
return null;
}
use of org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel in project webtools.sourceediting by eclipse.
the class BreakpointRulerAction method getMarkers.
/**
* Returns all breakpoint markers which include the ruler's line of activity.
*
* @return an array of markers which include the ruler's line of activity
*/
protected IMarker[] getMarkers() {
List markers = new ArrayList();
IResource resource = getResource();
IDocument document = getDocument();
AbstractMarkerAnnotationModel annotationModel = getAnnotationModel();
if (resource != null && annotationModel != null && resource.exists()) {
try {
IMarker[] allMarkers = resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
if (allMarkers != null) {
for (int i = 0; i < allMarkers.length; i++) {
if (includesRulerLine(annotationModel.getMarkerPosition(allMarkers[i]), document)) {
markers.add(allMarkers[i]);
}
}
}
} catch (CoreException x) {
//
}
}
return (IMarker[]) markers.toArray(new IMarker[0]);
}
Aggregations