com.ibm.rational.common.test.editor.framework

Class MarkerUtil



  • public class MarkerUtil
    extends Object

    MarkerUtil

    In version 6.1.2, this class is used internally by test Editor. It is subject to change in the future version of the product.
    • Field Detail

      • PID

        public static String PID
      • MODEL_MARKER

        public static String MODEL_MARKER
        Defines model marker type.
      • TEST_ERROR_MARKER

        public static String TEST_ERROR_MARKER
        Defines model error marker type.
      • TEST_BOOKMARK

        public static String TEST_BOOKMARK
        Defines model bookmark marker type.
      • TEST_SEARCH_MATCH

        public static String TEST_SEARCH_MATCH
        Defines model search marker type.
      • TEST_ID

        public static String TEST_ID
        Test ID marker attribute.
      • OBJECT_ID

        public static String OBJECT_ID
        Primary object attribute. Primary object must be visible in the editor tree.
      • SUBOBJECT_ID

        public static String SUBOBJECT_ID
        Secondary object attribute. Secondary object is not visible in the editor tree. It can be displayed in the details section or otherwise help to identify the target.
      • ATTRIBUTE_NAME

        public static String ATTRIBUTE_NAME
        The name of the attribute. Used to highlight ranges within model textual data.
      • ERROR_ID

        public static String ERROR_ID
      • PERMANENT_ERROR

        public static final String PERMANENT_ERROR
    • Constructor Detail

      • MarkerUtil

        public MarkerUtil()
    • Method Detail

      • createBookmarkMarker

        public static IMarker createBookmarkMarker(TestEditor editor,
                                   CBActionElement element,
                                   String message,
                                   String fieldName,
                                   Point location)
        Creates bookmark for textual data in a field.
        Parameters:
        editor - TestEditor.
        element - CBActionElement. Primary element.
        message - String. Bookmark label
        fieldName - 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.
        Returns:
        @return IMarker with type MarkerUtil.TEST_BOOKMARK
      • findBookmark

        public static IMarker[] findBookmark(TestEditor editor,
                             CBActionElement element)
        Finds bookmarks that belong to the given object.
        Parameters:
        editor - TestEditor.
        element - CBActionElement. Primary element visible in editor tree.
        Returns:
        IMarker[]. Array of markers that belong to the given element. The array is empty if no markers were found. Stale markers are not included.
      • createErrorMarker

        public 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. The element1 is displayed in the tree, while element2 is displayed in a table or tree in the details section. Navigation will set selection to the element1 in the Main Tree and then set focus to the control with attribute_name name. Inside that control, the element2 will be selected.
        Parameters:
        editor - TestEditor
        element1 - Primary object
        element2 - Secondary object
        message - Error text
        attr_name - Name of the control that displays the secondary object
        severity -
        Returns:
        IMarker test error marker.
        See Also:
        IMarker.SEVERITY_ERROR, IMarker.SEVERITY_WARNING, IMarker.SEVERITY_INFO
      • getSeverity

        public static int getSeverity(IMarker marker)
        Returns severity
        Parameters:
        marker - IMarker
        Returns:
        int severity
        Since:
        7.0.1
      • getMessage

        public static String getMessage(IMarker marker)
        Returns message
        Parameters:
        marker - IMarker
        Returns:
        String
        Since:
        7.0.1
      • createErrorMarker

        public 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. 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.
        Parameters:
        editor - TestEditor
        element - CBActionElement with error
        message - Error text
        attribute_name - name of the attribute/control.
        offset - beginning of the text region with error, or -1 if line_number is given
        len - 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 -
        Returns:
        IMarker
        See Also:
        IMarker.SEVERITY_ERROR, IMarker.SEVERITY_WARNING, IMarker.SEVERITY_INFO
      • findModelObject

        public static CBActionElement findModelObject(IMarker marker,
                                      boolean type,
                                      CBTest test)
        Finds model element that has ID equal to the ID specified in the marker.
        Parameters:
        marker -
        type - boolean. If type is true, the MarkerUtil.OBJECT_ID is is considered, otherwise it is MarkerUtil.SUBOBJECT_ID.
        Returns:
        CBActionElement model element or null if object not found.
      • removeMarkers

        public static void removeMarkers(IMarker[] markers,
                         TestEditor editor)
        Deletes markers.
        Parameters:
        markers - IMArker[].
        editor - TestEditor
      • createSearchMatchMarker

        public static IMarker createSearchMatchMarker(TestEditor editor,
                                      CBActionElement element1,
                                      CBActionElement element2,
                                      String matchText,
                                      boolean caseSensitive,
                                      String attr_name)
        Create a search match marker for the test element1 and sub-element element2. The element1 is displayed in the tree, while element2 is displayed in a table or tree in the details section. Navigation will set selection to the element1 in the Main Tree and then set focus to the control with attribute_name name. Inside that control, the element2 will be selected.
        Parameters:
        editor - TestEditor
        element1 - Primary object
        element2 - Secondary object
        matchText - Match text
        caseSensitive -
        attr_name - Name of the control that displays the secondary object
        Returns:
        IMarker
      • createSearchMatchMarker

        public 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. The element1 is displayed in the tree, while element2 is displayed in a table or tree in the details section. Navigation will set selection to the element1 in the Main Tree and then set focus to the control with attribute_name name. Inside that control, the element2 will be selected.
        Parameters:
        editor - TestEditor
        element1 - Primary object
        element2 - Secondary object
        matchText - Match text
        caseSensitive - boolean
        regex - boolean.
        attr_name - Name of the control that displays the secondary object
        Returns:
        IMarker
      • createSearchMarker

        public static IMarker createSearchMarker(TestEditor editor,
                                 CBActionElement element,
                                 String text)
        Create a search match marker for the test element. Element is displayed in the main tree. Navigation will set selection to this element in the tree.
        Parameters:
        editor - TestEditor
        element - CBActionElement with error
        text - Match text.
      • createSearchMarker

        public 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. 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.
        Parameters:
        editor - TestEditor
        element - CBActionElement with error
        text - Search match text
        caseSensitive - 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 given
        len - 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.
        Returns:
        IMarker
      • createSearchMarker

        public static IMarker createSearchMarker(TestEditor editor,
                                 CBActionElement element,
                                 String text,
                                 boolean caseSensitive,
                                 String attribute_name,
                                 int offset,
                                 int len,
                                 int line_number)
        Create a search match marker for the test 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.
        Parameters:
        editor - TestEditor
        element - CBActionElement with error
        text - Search match text
        caseSensitive - boolean.
        attribute_name - name of the attribute/control.
        offset - beginning of the text region with error, or -1 if line_number is given
        len - 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.
        Returns:
        IMarker
      • createGenericMarker

        public static IMarker createGenericMarker(IResource resource,
                                  String markerType,
                                  String testId,
                                  CBActionElement element,
                                  String message,
                                  int severity)
        Creates a generic marker of type markerType
        Parameters:
        resource - - IResource of testsuite
        markerType - - type of the new marker. It's recommended for Bookmarks, Errors and Search markers to use those creation methods.
        testId - - id of the test
        element - - CBActionElement to select
        message - - String usage is consuming view-specific
        severity - - int usage is consuming view-specific
        Returns:
        IMarker
      • setId

        public static void setId(IMarker marker,
                 String uniqueId)
        Assigns an ID to this marker. IDs are required if marker needs to be found later.
        Parameters:
        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.
      • getUniqueId

        public static String getUniqueId(IMarker marker)
IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2013. All rights reserved.