public void valueChanged(TreeSelectionEvent e) {
try {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) resultsTree.getLastSelectedPathComponent();
SampleResult sr = (SampleResult) node.getUserObject();
AssertionResult[] results = sr.getAssertionResults();
CompareAssertionResult result = null;
for (AssertionResult r : results) {
if (r instanceof CompareAssertionResult) {
result = (CompareAssertionResult) r;
break;
}
}
if (result == null) {
result = new CompareAssertionResult(getName());
}
base.setText(result.getBaseResult());
secondary.setText(result.getSecondaryResult());
} catch (Exception err) {
base.setText(JMeterUtils.getResString("comparison_invalid_node") + err); //$NON-NLS-1$
secondary.setText(JMeterUtils.getResString("comparison_invalid_node") + err); //$NON-NLS-1$
}
base.setCaretPosition(0);