1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

Cosmetics.

Change-Id: I9cd2b475d2992086f4cf722c31c69d322377c484
This commit is contained in:
Sergey Prigogin 2016-04-08 11:55:58 -07:00
parent dfe76debe3
commit 9804e683e6

View file

@ -22,36 +22,20 @@ import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
import org.eclipse.cdt.core.model.ICModelMarker;
public class ExternalSearchAnnotationModel extends ResourceMarkerAnnotationModel {
private final IPath fLocation;
private final int fDepth;
private final String fLocationAttribute;
/**
* @param markerResource
* @param location
*/
public ExternalSearchAnnotationModel(IResource markerResource, IPath location) {
this(markerResource, location, IResource.DEPTH_ZERO, ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION);
}
/**
* @param markerResource
* @param location
* @param depth
*/
ExternalSearchAnnotationModel(IResource markerResource, IPath location, int depth) {
this(markerResource, location, depth, ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION);
}
/**
* @param markerResource
* @param location
* @param depth
* @param locationAttribute
*/
ExternalSearchAnnotationModel(IResource markerResource,
IPath location, int depth, String locationAttribute) {
ExternalSearchAnnotationModel(IResource markerResource, IPath location, int depth,
String locationAttribute) {
super(markerResource);
fLocation= location;
fDepth= depth;
@ -71,16 +55,11 @@ public class ExternalSearchAnnotationModel extends ResourceMarkerAnnotationModel
protected boolean isAcceptable(IMarker marker) {
boolean acceptable = false;
String externalFileName = marker.getAttribute(fLocationAttribute, null);
if (externalFileName != null) { // Only accept markers with external
// paths set
if (externalFileName != null) { // Only accept markers with external paths set.
IPath externalPath = new Path(externalFileName);
acceptable = externalPath.equals(fLocation); // Only accept
// markers for this
// annotation
// model's external
// editor
// Accept only markers for this annotation model's external editor.
acceptable = externalPath.equals(fLocation);
}
return acceptable;
}
}