}
@Override
public Fixture getFixture() {
String factType = valueWidget.getItemText(valueWidget.getSelectedIndex());
FactData factData = new FactData(
factType,
factNameTextBox.getText(),
false);
//Create new Field objects for new Fixture based upon the first existing of the same data-type
//Only the "first" existing of the same data-type is checked as second, third etc should have been
//based upon the first if they were all created after this fix for GUVNOR-1139 was implemented.
List<FactData> existingFactData = scenario.getFactTypesToFactData().get(factType);
if (existingFactData != null && existingFactData.size() > 0) {
for (Field field : existingFactData.get(0).getFieldData()) {
factData.getFieldData().add(
new FieldPlaceHolder(field.getName()));
}
}
return factData;