sourceStepCombo.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED && !selecting) {
TestPropertyHolder sourceStep = (TestPropertyHolder) sourceStepCombo.getSelectedItem();
PropertyTransfer valueTransfer = getCurrentTransfer();
if (valueTransfer != null) {
String name;
if (sourceStep == PropertyExpansionUtils.getGlobalProperties()) {
name = PropertyExpansion.GLOBAL_REFERENCE;
} else if (sourceStep == transferStep.getTestCase().getTestSuite().getProject()) {
name = PropertyExpansion.PROJECT_REFERENCE;
} else if (sourceStep == transferStep.getTestCase().getTestSuite()) {
name = PropertyExpansion.TESTSUITE_REFERENCE;
} else if (sourceStep == transferStep.getTestCase()) {
name = PropertyExpansion.TESTCASE_REFERENCE;
} else {
name = sourceStep.getModelItem().getName();
}
valueTransfer.setSourceStepName(name);
}
}
}
});
toolbar.add(UISupport.setFixedSize(sourceStepCombo, 180, 21));
toolbar.addUnrelatedGap();
toolbar.addFixed(new JLabel(" Property: "));
toolbar.addRelatedGap();
sourcePropertyCombo.setToolTipText("The property the value will be transferred from");
sourcePropertyCombo.setEnabled(false);
sourcePropertyCombo.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED && !selecting) {
TestProperty sourceProperty = (TestProperty) sourcePropertyCombo.getSelectedItem();
PropertyTransfer valueTransfer = getCurrentTransfer();
if (valueTransfer != null) {
valueTransfer.setSourcePropertyName(sourceProperty.getName());
}
}
}
});