Window.alert(constants.YouMustEnterAValidFactName());
} else {
if (scenario.isFactNameExisting(fn)) {
Window.alert(Format.format(constants.TheFactName0IsAlreadyInUsePleaseChooseAnotherName(), fn));
} else {
scenario.insertBetween(previousEx, new FactData(factTypes.getItemText(factTypes.getSelectedIndex()), factName.getText(), new ArrayList(), false));
renderEditor();
pop.hide();
}
}
}
});
HorizontalPanel insertFact = new HorizontalPanel();
insertFact.add(factTypes);
insertFact.add(new SmallLabel(constants.FactName()));
insertFact.add(factName);
insertFact.add(add);
pop.addAttribute(constants.InsertANewFact1(), insertFact);
List varsInScope = scenario.getFactNamesInScope(currentEx, false);
//now we do modifies & retracts
if (varsInScope.size() > 0) {
final ListBox modifyFacts = new ListBox();
for (int j = 0; j < varsInScope.size(); j++) {
modifyFacts.addItem((String) varsInScope.get(j));
}
add = new Button(constants.Add());
add.addClickListener(new ClickListener() {
public void onClick(Widget w) {
String fn = modifyFacts.getItemText(modifyFacts.getSelectedIndex());
String type = (String) scenario.getVariableTypes().get(fn);
scenario.insertBetween(previousEx, new FactData(type, fn, new ArrayList(), true));
renderEditor();
pop.hide();
}
});
HorizontalPanel modifyFact = new HorizontalPanel();