Class PropMarker

java.lang.Object
com.iizigo.prop.PropMarker
All Implemented Interfaces:
Runnable

public class PropMarker extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    final 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

    Constructors
    Constructor
    Description
    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 Type
    Method
    Description
    boolean
    createMarker(org.eclipse.core.resources.IResource resource)
    Creates the marker.
    static void
    deleteAllMarkers(org.eclipse.core.resources.IResource resource)
    Removes all markers for a resource directly or in a job if it fails.
    static void
    deleteAllMarkers(org.eclipse.core.resources.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(org.eclipse.core.resources.IResource resource, String markerID)
    Removes all markers of the IIZI Module type and any file errors associated with an attached property.
    void
    dispose(org.eclipse.core.resources.IResource resource)
    Disposes of a marker.
    static GProp<?>
    getProperty(org.eclipse.core.resources.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.
    The string representation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • MARKER_ID_PROPERTY

      public static final String MARKER_ID_PROPERTY
      The Property problem marker ID.
      See Also:
    • MARKER_ATTRIBUTE_PROPERTY_REFERENCE

      public static final String MARKER_ATTRIBUTE_PROPERTY_REFERENCE
      Attribute in Property problem marker for Property Reference.
      See Also:
    • MARKER_ATTRIBUTE_CHILD_NAME

      public static final String MARKER_ATTRIBUTE_CHILD_NAME
      Attribute in Property problem marker for Property Reference to a child name.
      See Also:
    • MARKER_ATTRIBUTE_PROPERTY_INDEX

      public static final String 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

      public final String markerID
      The Eclipse-registered marker ID.
    • severity

      public final int severity
      Marker severity: IMarker.SEVERITY_ERROR=2, IMarker.SEVERITY_WARNING=1 or IMarker.SEVERITY_INFO=0.
    • message

      public final String message
      The message.
    • location

      public final String location
      The location.
    • reference

      public final String reference
      Property reference of the error, null when not a property error.
    • index

      public final int index
      Index for property reference error, -1 when not set.
    • start

      public final int start
      The character start position of the marker, -1 when not position based.
    • length

      public final int length
      The character length of the marker, -1 when not position based.
    • quickFixIDs

      public final String[] quickFixIDs
      Array of registered quick-fixes for the problem (all must be registered in QuickFixer), never null.
    • childError

      public final String 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

      public PropMarker(PropErrorItemOrigin errorItemOrigin)
      Creates a new property marker for a property error item.
      Parameters:
      errorItemOrigin - The error item including origin.
  • Method Details

    • getProperty

      public static GProp<?> getProperty(org.eclipse.core.resources.IMarker marker)
      Gets the property from the reference in the marker.
    • registerMarker

      public static void registerMarker(String markerID, boolean isPersistent)
      Registers a marker for a plug-in.
    • deleteMarkers

      public static void deleteMarkers(org.eclipse.core.resources.IResource resource, String markerID) throws org.eclipse.core.runtime.CoreException
      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:
      org.eclipse.core.runtime.CoreException - If a marker cannot be deleted.
    • deleteAllMarkers

      public static void deleteAllMarkers(org.eclipse.core.resources.IResource resource)
      Removes all markers for a resource directly or in a job if it fails.
      Parameters:
      resource - The resource.
    • deleteAllMarkers

      public static void deleteAllMarkers(org.eclipse.core.resources.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, or null to indicate all types.
      includeSubtypes - Whether or not to consider sub-types of the given type.
      depth - How far to recurse (see IResource.DEPTH_*).
      completed - A runnable that is called when it completes, null for none.
    • createMarker

      public boolean createMarker(org.eclipse.core.resources.IResource resource)
      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.
      Specified by:
      run in interface Runnable
    • dispose

      public void dispose(org.eclipse.core.resources.IResource resource)
      Disposes of a marker.
      Parameters:
      resource - The resource, or null for no marker removal on the resource.
    • toString

      public String toString()
      The string representation.
      Overrides:
      toString in class Object