public class MarkerHelper
extends java.lang.Object
IMarker
s. The main goal is to
simplify the creation of markers using the information described in
Diagnostic
s.Constructor and Description |
---|
MarkerHelper() |
Modifier and Type | Method and Description |
---|---|
protected void |
adjustMarker(IMarker marker,
Diagnostic diagnostic,
Diagnostic parentDiagnostic)
Clients should override this method to update the marker associated with the diagnostic.
|
protected java.lang.String |
composeMessage(Diagnostic diagnostic,
Diagnostic parentDiagnostic)
Returns the message that will be used with the marker associated with the given diagnostic.
|
void |
createMarkers(Diagnostic diagnostic)
Creates a marker based on the information available in the specified
diagnostic.
|
protected void |
createMarkers(IResource resource,
Diagnostic diagnostic,
Diagnostic parentDiagnostic) |
protected void |
deleteMarkers(IResource resource,
boolean includeSubtypes,
int depth) |
void |
deleteMarkers(java.lang.Object object)
Deletes a maker with id equals to the return of
getMarkerID()
from the IResource computed from the specified object. |
void |
deleteMarkers(java.lang.Object object,
boolean includeSubtypes,
int depth) |
java.lang.String |
getDiagnosticSource()
Returns the
source value used for creating diagnostics from markers. |
IEditorInput |
getEditorInput(java.lang.Object object) |
protected IFile |
getFile(Diagnostic diagnostic) |
protected IFile |
getFile(java.lang.Object datum) |
protected IFile |
getFile(URI uri) |
Diagnostic |
getMarkerDiagnostics(java.lang.Object object,
IFile file)
Converts markers in the file to diagnostics.
|
protected java.lang.String |
getMarkerID() |
java.util.List<?> |
getTargetObjects(java.lang.Object object,
IMarker marker) |
protected boolean |
hasMarkers(IResource resource,
boolean includeSubtypes,
int depth) |
boolean |
hasMarkers(java.lang.Object object)
Returns whether the a maker with id equals to the return of
getMarkerID()
is available in the IResource computed from the specified object. |
boolean |
hasMarkers(java.lang.Object object,
boolean includeSubtypes,
int depth) |
public java.lang.String getDiagnosticSource()
source
value used for creating diagnostics
from markers.protected java.lang.String getMarkerID()
protected IFile getFile(java.lang.Object datum)
protected IFile getFile(Diagnostic diagnostic)
protected IFile getFile(URI uri)
public void createMarkers(Diagnostic diagnostic) throws CoreException
Creates a marker based on the information available in the specified
diagnostic. The marker's id is defined by getMarkerID()
.
The default implementation looks in the diagnostic's data array for objects that would allow an IFile to be computed
diagnostic
- CoreException
protected void createMarkers(IResource resource, Diagnostic diagnostic, Diagnostic parentDiagnostic) throws CoreException
CoreException
protected void adjustMarker(IMarker marker, Diagnostic diagnostic, Diagnostic parentDiagnostic) throws CoreException
marker
- the marker to be updated.diagnostic
- the diagnostic associated with the marker.parentDiagnostic
- the parent of the diagnostic, if any.CoreException
protected java.lang.String composeMessage(Diagnostic diagnostic, Diagnostic parentDiagnostic)
diagnostic
- the diagnostic.parentDiagnostic
- the parent of the diagnostic, if any.public boolean hasMarkers(java.lang.Object object)
getMarkerID()
is available in the IResource computed from the specified object.object
- public boolean hasMarkers(java.lang.Object object, boolean includeSubtypes, int depth)
protected boolean hasMarkers(IResource resource, boolean includeSubtypes, int depth)
public void deleteMarkers(java.lang.Object object)
getMarkerID()
from the IResource computed from the specified object.object
- public void deleteMarkers(java.lang.Object object, boolean includeSubtypes, int depth)
protected void deleteMarkers(IResource resource, boolean includeSubtypes, int depth)
public IEditorInput getEditorInput(java.lang.Object object)
public java.util.List<?> getTargetObjects(java.lang.Object object, IMarker marker)
public Diagnostic getMarkerDiagnostics(java.lang.Object object, IFile file)