public final class MarkerUtilities extends Object
CoreException
s are logged to workbench).
This class provides static methods only; it is not intended to be instantiated or subclassed by clients.
Modifier and Type | Method and Description |
---|---|
static void |
createMarker(IResource resource,
Map attributes,
String markerType)
Creates a marker on the given resource with the given type and attributes.
|
static int |
getCharEnd(IMarker marker)
Returns the ending character offset of the given marker.
|
static int |
getCharStart(IMarker marker)
Returns the starting character offset of the given marker.
|
static int |
getLineNumber(IMarker marker)
Returns the line number of the given marker.
|
static String |
getMarkerType(IMarker marker)
Returns the marker type of the given marker or
null if
the type could not be determined. |
static String |
getMessage(IMarker marker)
Returns the message associated with the given marker.
|
static int |
getPriority(IMarker marker)
Returns the priority of the given marker.
|
static int |
getSeverity(IMarker marker)
Returns the severity of the given marker.
|
static String[] |
getSuperTypes(String markerType)
Returns the list of super types for the given marker.
|
static boolean |
isMarkerType(IMarker marker,
String type)
Returns whether the given marker is of the given type (either directly or indirectly).
|
static void |
setCharEnd(IMarker marker,
int charEnd)
Sets the ending character offset of the given marker.
|
static void |
setCharEnd(Map map,
int charEnd)
Sets the ending character offset in the given map using the standard
marker attribute name as the key.
|
static void |
setCharStart(IMarker marker,
int charStart)
Sets the starting character offset of the given marker.
|
static void |
setCharStart(Map map,
int charStart)
Sets the starting character offset in the given map using the standard
marker attribute name as the key.
|
static void |
setLineNumber(IMarker marker,
int lineNum)
Sets the line number of the given marker.
|
static void |
setLineNumber(Map map,
int lineNum)
Sets the line number in the given map using the standard marker attribute
name as the key.
|
static void |
setMessage(Map map,
String message)
Sets the message in the given map using the standard marker attribute name
as the key.
|
public static int getCharEnd(IMarker marker)
marker
- the marker-1
if not setIMarker.CHAR_END
,
IMarker.getAttribute(java.lang.String, int)
public static int getCharStart(IMarker marker)
marker
- the marker-1
if not setIMarker.CHAR_START
,
IMarker.getAttribute(java.lang.String,int)
public static int getLineNumber(IMarker marker)
marker
- the marker-1
if not setIMarker.LINE_NUMBER
,
IMarker.getAttribute(java.lang.String,int)
public static int getPriority(IMarker marker)
marker
- the markerIMarker.PRIORITY_NORMAL
if not setIMarker.PRIORITY
,
IMarker.PRIORITY_NORMAL
,
IMarker.getAttribute(java.lang.String,int)
public static int getSeverity(IMarker marker)
marker
- the markerIMarker.SEVERITY_INFO
if not setIMarker.SEVERITY
,
IMarker.SEVERITY_INFO
,
IMarker.getAttribute(java.lang.String,int)
public static boolean isMarkerType(IMarker marker, String type)
marker
- the marker to be checkedtype
- the reference typetrue
if maker is an instance of the reference typepublic static String getMarkerType(IMarker marker)
null
if
the type could not be determined.marker
- the markerpublic static String getMessage(IMarker marker)
marker
- the markernull
public static void setCharEnd(IMarker marker, int charEnd)
marker
- the markercharEnd
- the ending character offsetIMarker.CHAR_END
,
IMarker.setAttribute(java.lang.String,int)
public static void setCharEnd(Map map, int charEnd)
map
- the map (key type: String
, value type:
Object
)charEnd
- the ending character offsetIMarker.CHAR_END
public static void setCharStart(IMarker marker, int charStart)
marker
- the markercharStart
- the starting character offsetIMarker.CHAR_START
,
IMarker.setAttribute(java.lang.String,int)
public static void setCharStart(Map map, int charStart)
map
- the map (key type: String
, value type:
Object
)charStart
- the starting character offsetIMarker.CHAR_START
public static void setLineNumber(IMarker marker, int lineNum)
marker
- the markerlineNum
- the line numberIMarker.LINE_NUMBER
,
IMarker.setAttribute(java.lang.String,int)
public static void setLineNumber(Map map, int lineNum)
map
- the map (key type: String
, value type:
Object
)lineNum
- the line numberIMarker.LINE_NUMBER
public static void setMessage(Map map, String message)
map
- the map (key type: String
, value type:
Object
)message
- the messageIMarker.MESSAGE
public static void createMarker(IResource resource, Map attributes, String markerType) throws CoreException
This method modifies the workspace (progress is not reported to the user).
resource
- the resourceattributes
- the attribute map (key type: String
,
value type: Object
)markerType
- the type of markerCoreException
- if this method failsIResource.createMarker(java.lang.String)
public static String[] getSuperTypes(String markerType)
markerType
- the marker's type
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.