public class MarkerUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_NAME
The name of the attribute.
|
static String |
ERROR_ID |
static boolean |
FormatLocationInfo
Flag that tells
MarkerUtil.createLocationInfo(TestEditor, CBActionElement, CBActionElement) to create abbreviated
location information string for markers. |
static String |
MODEL_MARKER
Defines model marker type.
|
static String |
OBJECT_ID
Primary object attribute.
|
static String |
PERMANENT_ERROR |
static String |
PID |
static String |
SUBOBJECT_ID
Secondary object attribute.
|
static String |
TEST_BOOKMARK
Defines model bookmark marker type.
|
static String |
TEST_ERROR_MARKER
Defines model error marker type.
|
static String |
TEST_ID
Test ID marker attribute.
|
static String |
TEST_SEARCH_MATCH
Defines model search marker type.
|
| Constructor and Description |
|---|
MarkerUtil() |
| Modifier and Type | Method and Description |
|---|---|
static IMarker |
createBookmarkMarker(TestEditor editor,
CBActionElement element,
String message)
Creates bookmark marker.
|
static IMarker |
createBookmarkMarker(TestEditor editor,
CBActionElement element,
String message,
String fieldName,
Point location)
Creates bookmark for textual data in a field.
|
static IMarker |
createErrorMarker(TestEditor editor,
CBActionElement element1,
CBActionElement element2,
String message,
String attr_name,
int severity)
Create a marker for the test element1 and sub-element element2.
|
static IMarker |
createErrorMarker(TestEditor editor,
CBActionElement element,
String message,
int severity)
Create a marker for the test element.
|
static IMarker |
createErrorMarker(TestEditor editor,
CBActionElement element,
String message,
String attribute_name,
int offset,
int len,
int line_number,
int severity)
Create a marker for the test
element. |
static IMarker |
createGenericMarker(IResource resource,
String markerType,
String testId,
CBActionElement element,
String message,
int severity)
Creates a generic marker of type
markerType |
static String |
createLocationInfo(TestEditor editor,
CBActionElement element) |
static String |
createLocationInfo(TestEditor editor,
CBActionElement element,
CBActionElement upToThisOne) |
static IMarker |
createSearchMarker(TestEditor editor,
CBActionElement element,
String text)
Create a search match marker for the test element.
|
static IMarker |
createSearchMarker(TestEditor editor,
CBActionElement element,
String text,
boolean caseSensitive,
boolean regex,
String attribute_name,
int offset,
int len,
int line_number)
Create a search match marker for the test
element. |
static IMarker |
createSearchMarker(TestEditor editor,
CBActionElement element,
String text,
boolean caseSensitive,
String attribute_name,
int offset,
int len,
int line_number)
Deprecated.
|
static IMarker |
createSearchMatchMarker(TestEditor editor,
CBActionElement element1,
CBActionElement element2,
String matchText,
boolean caseSensitive,
boolean regex,
String attr_name)
Create a search match marker for the test element1 and sub-element element2.
|
static IMarker |
createSearchMatchMarker(TestEditor editor,
CBActionElement element1,
CBActionElement element2,
String matchText,
boolean caseSensitive,
String attr_name)
Deprecated.
|
static IMarker[] |
findBookmark(TestEditor editor,
CBActionElement element)
Finds bookmarks that belong to the given object.
|
static CBActionElement |
findModelObject(IMarker marker,
boolean type,
CBTest test)
Finds model element that has ID equal to the ID specified in the marker.
|
static String |
getMessage(IMarker marker)
Returns message
|
static int |
getSeverity(IMarker marker)
Returns severity
|
static String |
getUniqueId(IMarker marker) |
static void |
removeMarkers(IMarker[] markers,
TestEditor editor)
Deletes markers.
|
static void |
setId(IMarker marker,
String uniqueId)
Assigns an ID to this marker.
|
public static boolean FormatLocationInfo
MarkerUtil.createLocationInfo(TestEditor, CBActionElement, CBActionElement) to create abbreviated
location information string for markers. Default is true. Set to false when the label
of the element in question contains error. This will prevent infinite loop. Reset back to true when
not needed.public static String PID
public static String MODEL_MARKER
public static String TEST_ERROR_MARKER
public static String TEST_BOOKMARK
public static String TEST_SEARCH_MATCH
public static String TEST_ID
public static String OBJECT_ID
public static String SUBOBJECT_ID
public static String ATTRIBUTE_NAME
public static String ERROR_ID
public static final String PERMANENT_ERROR
public static IMarker createBookmarkMarker(TestEditor editor, CBActionElement element, String message)
CreateBookmarkAction.editor - TestEditor.element - Primary model element (visible in the editor tree).message - String. Bookmar label.MarkerUtil.TEST_BOOKMARKCreateBookmarkAction,
MarkerUtil.createBookmarkMarker(TestEditor, CBActionElement, String, String, Point)public static String createLocationInfo(TestEditor editor, CBActionElement element)
public static String createLocationInfo(TestEditor editor, CBActionElement element, CBActionElement upToThisOne)
public static IMarker createBookmarkMarker(TestEditor editor, CBActionElement element, String message, String fieldName, Point location)
editor - TestEditor.element - CBActionElement. Primary element.message - String. Bookmark labelfieldName - String. Name of the field attribute.location - Point. Location within the field attribute.
Typically this is the same as selection, but not always.
Point.x is the beginning and Point.y is end, not the length, of the selection.MarkerUtil.TEST_BOOKMARKpublic static IMarker[] findBookmark(TestEditor editor, CBActionElement element)
editor - TestEditor.element - CBActionElement. Primary element visible in editor tree.element. The array is empty if no markers were found. Stale markers are not included.public static IMarker createErrorMarker(TestEditor editor, CBActionElement element, String message, int severity)
element in the tree.editor - TestEditorelement - CBActionElement with errormessage - Error textseverity - int. One of the values defined in IMarker.IMarker.SEVERITY_ERROR,
IMarker.SEVERITY_WARNING,
IMarker.SEVERITY_INFOpublic static IMarker createErrorMarker(TestEditor editor, CBActionElement element1, CBActionElement element2, String message, String attr_name, int severity)
attribute_name name. Inside that control, the element2 will be selected.editor - TestEditorelement1 - Primary objectelement2 - Secondary objectmessage - Error textattr_name - Name of the control that displays the secondary objectseverity - IMarker.SEVERITY_ERROR,
IMarker.SEVERITY_WARNING,
IMarker.SEVERITY_INFOpublic static int getSeverity(IMarker marker)
marker - IMarkerpublic static String getMessage(IMarker marker)
marker - IMarkerpublic static IMarker createErrorMarker(TestEditor editor, CBActionElement element, String message, String attribute_name, int offset, int len, int line_number, int severity)
element. The element is displayed in the tree. Navigation will set
selection to the element in the Main Tree and then set focus to the
control with attribute_name name. The control is assumed to be either StyledText or
Text. Inside that control, selection will be set to either offset/len,
or line_number.editor - TestEditorelement - CBActionElement with errormessage - Error textattribute_name - name of the attribute/control.offset - beginning of the text region with error, or -1 if line_number is givenlen - end of the text region with error, or -1 for the entire text (if offset is not -1)line_number - the line with error, or -1 if offset is not -1.severity - IMarker.SEVERITY_ERROR,
IMarker.SEVERITY_WARNING,
IMarker.SEVERITY_INFOpublic static CBActionElement findModelObject(IMarker marker, boolean type, CBTest test)
marker - type - boolean. If type is true, the MarkerUtil.OBJECT_ID is is considered, otherwise it is MarkerUtil.SUBOBJECT_ID.null if object not found.public static void removeMarkers(IMarker[] markers, TestEditor editor)
markers - IMArker[].editor - TestEditorpublic static IMarker createSearchMatchMarker(TestEditor editor, CBActionElement element1, CBActionElement element2, String matchText, boolean caseSensitive, String attr_name)
MarkerUtil.createSearchMatchMarker(TestEditor, CBActionElement, CBActionElement, String, boolean, boolean, String)attribute_name name. Inside that control, the element2 will be selected.editor - TestEditorelement1 - Primary objectelement2 - Secondary objectmatchText - Match textcaseSensitive - attr_name - Name of the control that displays the secondary objectpublic static IMarker createSearchMatchMarker(TestEditor editor, CBActionElement element1, CBActionElement element2, String matchText, boolean caseSensitive, boolean regex, String attr_name)
attribute_name name. Inside that control, the element2 will be selected.editor - TestEditorelement1 - Primary objectelement2 - Secondary objectmatchText - Match textcaseSensitive - booleanregex - boolean.attr_name - Name of the control that displays the secondary objectpublic static IMarker createSearchMarker(TestEditor editor, CBActionElement element, String text)
element in the tree.editor - TestEditorelement - CBActionElement with errortext - Match text.public static IMarker createSearchMarker(TestEditor editor, CBActionElement element, String text, boolean caseSensitive, boolean regex, String attribute_name, int offset, int len, int line_number)
element. The element is displayed in the tree. Navigation will set
selection to the element in the Main Tree and then set focus to the
control with attribute_name name. The control is assumed to be either StyledText or
Text. Inside that control, selection will be set to either offset/len,
or line_number.editor - TestEditorelement - CBActionElement with errortext - Search match textcaseSensitive - boolean.regex - boolean. Was the search don using regular expression.attribute_name - name of the attribute/control.offset - beginning of the text region with error, or -1 if line_number is givenlen - end of the text region with error, or -1 for the entire text (if offset is not -1)line_number - the line with error, or -1 if offset is not -1.public static IMarker createSearchMarker(TestEditor editor, CBActionElement element, String text, boolean caseSensitive, String attribute_name, int offset, int len, int line_number)
MarkerUtil.createSearchMarker(TestEditor, CBActionElement, String, boolean, boolean, String, int, int, int)element. The element is displayed in the tree. Navigation will set
selection to the element in the Main Tree and then set focus to the
control with attribute_name name. The control is assumed to be either StyledText or
Text. Inside that control, selection will be set to either offset/len,
or line_number.editor - TestEditorelement - CBActionElement with errortext - Search match textcaseSensitive - boolean.attribute_name - name of the attribute/control.offset - beginning of the text region with error, or -1 if line_number is givenlen - end of the text region with error, or -1 for the entire text (if offset is not -1)line_number - the line with error, or -1 if offset is not -1.public static IMarker createGenericMarker(IResource resource, String markerType, String testId, CBActionElement element, String message, int severity)
markerTyperesource - - IResource of testsuitemarkerType - - type of the new marker. It's recommended for Bookmarks, Errors and Search markers to use those creation methods.testId - - id of the testelement - - CBActionElement to selectmessage - - String usage is consuming view-specificseverity - - int usage is consuming view-specificpublic static void setId(IMarker marker, String uniqueId)
marker - IMarker marker created by of the 'create' methods.uniqueId - String the ID which must be unique within the scope of the element for which the marker was created.© Copyright IBM Corp. 2013. All rights reserved.