TreePath[] selectionPaths = assertionTree.getSelectionPaths();
for (int i = 0; i < selectionPaths.length; i++) {
TreePath path = selectionPaths[i];
Object[] objects = path.getPath();
final StringBuffer sb = new StringBuffer();
MComponent forComponent = mcomponent;
for (int j = 1; j < objects.length; j++) {
final AssertionTreeNode node = (AssertionTreeNode) objects[j];
if (node.getObject() instanceof MComponent) {
forComponent = (MComponent) node.getObject();
sb.setLength(0);
continue;
}
sb.append(node.getProperty());
if (j < objects.length - 1) {
if (!((AssertionTreeNode) objects[j + 1]).getProperty().startsWith("["))
sb.append(".");
} else {
IScriptElement enscript;
String property = sb.toString();
if (action == ASSERT_ACTION) {
if (property.equals("Content") && forComponent instanceof MCollectionComponent)
enscript = new AssertContent(forComponent.getComponentId(),
((MCollectionComponent) forComponent).getContent(), scriptModel, windowMonitor)
.enscript(forComponent);
else {
String value;
if (property.equals("Text"))
value = forComponent.getComparableObject().toString();
else
value = forComponent.getProperty(property);
enscript = new AssertPropertyAction(forComponent.getComponentId(), property, value, scriptModel,
windowMonitor).enscript(forComponent);
}
} else {
String value;
if (property.equals("Text"))
value = forComponent.getComparableObject().toString();
else
value = forComponent.getProperty(property);
enscript = new WaitPropertyAction(forComponent.getComponentId(), property, value, scriptModel,
windowMonitor).enscript(forComponent);
}
if (getFinder() != null)
getFinder().markUsed(forComponent);
getRecorder().record(enscript);