com.ibm.rational.common.test.editor.framework.extensions
Class ModelErrorChecker
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ModelErrorChecker
public ModelErrorChecker()
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
- CBActionElementmsg
- String
createError
public IMarker createError(CBActionElement element,
String msg)
- Parameters:
element
- CBActionElementmsg
- 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 treeelement2
- CBActionElement
secondary element (shown on the details section)attr_name
- String
Field name of the widget that displays the secondary elementmsg
- 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)
© Copyright IBM Corp. 2012. All rights reserved.