IBM Rational Performance Tester SDK

com.ibm.rational.common.test.editor.framework.extensions
Class ModelErrorChecker

java.lang.Object
  extended by com.ibm.rational.common.test.editor.framework.extensions.ModelErrorChecker
All Implemented Interfaces:
com.ibm.rational.common.test.editor.framework.kernel.interfaces.IElementErrorChecker

public abstract class ModelErrorChecker
extends Object
implements com.ibm.rational.common.test.editor.framework.kernel.interfaces.IElementErrorChecker


Constructor Summary
ModelErrorChecker()
           
 
Method Summary
 void clearErrors(CBActionElement element)
           
 IMarker createError(CBActionElement element1, CBActionElement element2, String attr_name, String msg)
          Create an error for element and secondary element.
 IMarker createError(CBActionElement element, String msg)
           
 IMarker createWarning(CBActionElement element, String msg)
           
 void flushCachedData()
           
 com.ibm.rational.common.test.editor.framework.jobs.ErrorCheckerJob getErrorCheckerJob()
           
 TestEditor getTestEditor()
           
abstract  boolean hasErrors(CBActionElement element)
          This method ie expected to examine the passed object for errors.
 void setErrorCheckerJob(com.ibm.rational.common.test.editor.framework.jobs.ErrorCheckerJob errorCheckerJob)
           
 void setTestEditor(TestEditor testEditor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelErrorChecker

public ModelErrorChecker()
Method Detail

hasErrors

public abstract boolean hasErrors(CBActionElement element)
This method ie expected to examine the passed object for errors. For every error found, one of the MarkerUtil.createErrorMarker methods should be called.
Here is an example of typical handling:
 boolean error_condition = ... // check for error
 if( error_condition == true )
 {
    // the following two lines must be executed for every error found
    IMarker marker = MarkerUtil.createMarker( getTestEditor(), element, ... ); 
    ModelStateManager.setError( element, getTestEditor(), marker );
    return true;  
 }
 else
 {
    return false; // no errors were found
 }
 

Specified by:
hasErrors in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.IElementErrorChecker
Returns:
boolean true if errors were found, false otherwise.
See Also:
IElementErrorChecker.hasErrors(com.ibm.rational.test.common.models.behavior.CBActionElement), MarkerUtil.createErrorMarker(TestEditor, CBActionElement, CBActionElement, String, String, int), MarkerUtil.createErrorMarker(TestEditor, CBActionElement, String, int), MarkerUtil.createErrorMarker(TestEditor, CBActionElement, String, String, int, int, int, int), ModelStateManager.setError(CBActionElement, TestEditor, IMarker)

getTestEditor

public TestEditor getTestEditor()
Specified by:
getTestEditor in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.IElementErrorChecker
Returns:
Returns the testEditor.

setTestEditor

public void setTestEditor(TestEditor testEditor)
Specified by:
setTestEditor in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.IElementErrorChecker
Parameters:
testEditor - The testEditor to set.

createWarning

public IMarker createWarning(CBActionElement element,
                             String msg)
Parameters:
element - CBActionElement
msg - String

createError

public IMarker createError(CBActionElement element,
                           String msg)
Parameters:
element - CBActionElement
msg - String
Returns:
IMarker marker can be modified to store additional data.

createError

public IMarker createError(CBActionElement element1,
                           CBActionElement element2,
                           String attr_name,
                           String msg)
Create an error for element and secondary element.

Parameters:
element1 - CBActionElement main element (shown in the editor tree
element2 - CBActionElement secondary element (shown on the details section)
attr_name - String Field name of the widget that displays the secondary element
msg - String Error message
Returns:
IMarker marker can be modified to store additional data.

flushCachedData

public void flushCachedData()

clearErrors

public void clearErrors(CBActionElement element)

getErrorCheckerJob

public final com.ibm.rational.common.test.editor.framework.jobs.ErrorCheckerJob getErrorCheckerJob()

setErrorCheckerJob

public final void setErrorCheckerJob(com.ibm.rational.common.test.editor.framework.jobs.ErrorCheckerJob errorCheckerJob)

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.