Package com.iizigo.prop
Class PropMarker
java.lang.Object
com.iizigo.prop.PropMarker
- All Implemented Interfaces:
Runnable
The property marker is a class that holds error/warning/information about a property that is stored in a file.
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionfinal String
The name of child property in error.final int
Index for property reference error, -1 when not set.final int
The character length of the marker, -1 when not position based.final String
The location.static final String
Attribute in Property problem marker for Property Reference to a child name.static final String
Attribute in Property problem marker for Property Reference with an indexed multi-property, assigns an Integer value (equal or greater than zero), otherwise not set.static final String
Attribute in Property problem marker for Property Reference.static final String
The Property problem marker ID.final String
The Eclipse-registered marker ID.final String
The message.final String[]
Array of registered quick-fixes for the problem (all must be registered in QuickFixer), never null.final String
Property reference of the error, null when not a property error.final int
Marker severity: IMarker.SEVERITY_ERROR=2, IMarker.SEVERITY_WARNING=1 or IMarker.SEVERITY_INFO=0.final int
The character start position of the marker, -1 when not position based.Constructor Summary
ConstructorDescriptionPropMarker
(PropErrorItemOrigin errorItemOrigin) Creates a new property marker for a property error item.PropMarker
(String markerID, boolean isError, String message, int start, int length, String... quickFixIDs) Creates a new property marker for a property, specialized to text file position, e.g for Java source file.PropMarker
(String markerID, boolean isError, String message, String location, String... quickFixIDs) Creates a new property marker for a property, typically used for general errors.Method Summary
Modifier and TypeMethodDescriptionboolean
createMarker
(IResource resource) Creates the marker.static void
deleteAllMarkers
(IResource resource) Removes all markers for a resource directly or in a job if it fails.static void
deleteAllMarkers
(IResource resource, String type, boolean includeSubtypes, int depth, Runnable completed) Removes all markers for a resource directly or in a job if it fails.static void
deleteMarkers
(IResource resource, String markerID) Removes all markers of the IIZI Module type and any file errors associated with an attached property.void
Disposes of a marker.static GProp
<?> getProperty
(IMarker marker) Gets the property from the reference in the marker.static void
registerMarker
(String markerID, boolean isPersistent) Registers a marker for a plug-in.void
run()
Performs the adding of the marker in a job.toString()
The string representation.
Field Details
MARKER_ID_PROPERTY
The Property problem marker ID.- See Also:
MARKER_ATTRIBUTE_PROPERTY_REFERENCE
Attribute in Property problem marker for Property Reference.- See Also:
MARKER_ATTRIBUTE_CHILD_NAME
Attribute in Property problem marker for Property Reference to a child name.- See Also:
MARKER_ATTRIBUTE_PROPERTY_INDEX
Attribute in Property problem marker for Property Reference with an indexed multi-property, assigns an Integer value (equal or greater than zero), otherwise not set.- See Also:
markerID
The Eclipse-registered marker ID.severity
public final int severityMarker severity: IMarker.SEVERITY_ERROR=2, IMarker.SEVERITY_WARNING=1 or IMarker.SEVERITY_INFO=0.message
The message.location
The location.reference
Property reference of the error, null when not a property error.index
public final int indexIndex for property reference error, -1 when not set.start
public final int startThe character start position of the marker, -1 when not position based.length
public final int lengthThe character length of the marker, -1 when not position based.quickFixIDs
Array of registered quick-fixes for the problem (all must be registered in QuickFixer), never null.childError
The name of child property in error.
Constructor Details
PropMarker
public PropMarker(String markerID, boolean isError, String message, String location, String... quickFixIDs) Creates a new property marker for a property, typically used for general errors.- Parameters:
markerID
- The Eclipse-registered marker ID.isError
- Flag for error, false = warning.message
- The message.location
- The location.quickFixIDs
- List of registered quick-fixes for the problem (all must be registered in QuickFixer)-
PropMarker
public PropMarker(String markerID, boolean isError, String message, int start, int length, String... quickFixIDs) Creates a new property marker for a property, specialized to text file position, e.g for Java source file.- Parameters:
markerID
- The Eclipse-registered marker ID.isError
- Flag for error, false = warning.message
- The message.start
- The (character) start location in the file.length
- The length of the marker.quickFixIDs
- List of registered quick-fixes for the problem (all must be registered in QuickFixer)-
PropMarker
Creates a new property marker for a property error item.- Parameters:
errorItemOrigin
- The error item including origin.
Method Details
getProperty
Gets the property from the reference in the marker.registerMarker
Registers a marker for a plug-in.deleteMarkers
Removes all markers of the IIZI Module type and any file errors associated with an attached property.- Parameters:
resource
- The resource.markerID
- The marker ID to remove or null for all.- Throws:
CoreException
- If a marker cannot be deleted.
deleteAllMarkers
Removes all markers for a resource directly or in a job if it fails.- Parameters:
resource
- The resource.
deleteAllMarkers
public static void deleteAllMarkers(IResource resource, String type, boolean includeSubtypes, int depth, Runnable completed) Removes all markers for a resource directly or in a job if it fails.- Parameters:
resource
- The resource.type
- The type of marker to consider, ornull
to indicate all types.includeSubtypes
- Whether or not to consider sub-types of the given type.depth
- How far to recurse (seeIResource.DEPTH_*
).completed
- A runnable that is called when it completes, null for none.
createMarker
Creates the marker.- Returns:
- false if the marker cannot be created due to resource inaccessibility, true otherwise.
run
public void run()Performs the adding of the marker in a job.dispose
Disposes of a marker.- Parameters:
resource
- The resource, or null for no marker removal on the resource.
toString
The string representation.