}
});
form.addAttribute(constants.LiteralValue() + ":",
widgets(lit,
new InfoPopup(constants.Literal(),
constants.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation())));
if(model.isTemplate()){
Button templateButton = new Button(constants.TemplateKey(), new ClickListener() {
public void onClick(Widget arg0) {
value.nature = ActionFieldValue.TYPE_TEMPLATE;
value.value = " ";
makeDirty();
refresh();
form.hide();
}
});
form.addAttribute(constants.TemplateKey() + ":",
widgets(templateButton,
new InfoPopup(constants.Literal(),
constants.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation())));
}
form.addRow(new HTML("<hr/>"));
form.addRow(new SmallLabel(constants.AdvancedSection()));
Button formula = new Button(constants.Formula());
formula.addClickListener(new ClickListener() {
public void onClick(Widget w) {
value.nature = ActionFieldValue.TYPE_FORMULA;
value.value = "=";
makeDirty();
refresh();
form.hide();
}
});
/*
* If there is a bound variable that is the same type of the current
* variable type, then show abutton
*/
List<String> vars = model.getModel().getBoundFacts();
List<String> vars2 = model.getModel().getRhsBoundFacts();
for (String i : vars2) {
vars.add(i);
}
for (String v : vars) {
boolean createButton = false;
Button variable = new Button(constants.BoundVariable());
if (vars2.contains(v) == false) {
FactPattern factPattern = model.getModel().getBoundFact(v);
if (factPattern.factType.equals(this.variableType)) {
createButton = true;
}
} else {
ActionInsertFact factPattern = model.getModel().getRhsBoundFact(v);
if (factPattern.factType.equals(this.variableType)) {
createButton = true;
}
}
if (createButton == true) {
form.addAttribute(constants.BoundVariable() + ":",
variable);
variable.addClickListener(new ClickListener() {
public void onClick(Widget w) {
value.nature = ActionFieldValue.TYPE_VARIABLE;
value.value = "=";
makeDirty();
refresh();
form.hide();
}
});
break;
}
}
form.addAttribute(constants.Formula() + ":",
widgets(formula,
new InfoPopup(constants.Formula(),
constants.FormulaTip())));
// if (model != null){
// for (int i=0;i< model.lhs.length;i++){
// IPattern p = model.lhs[i];