list.addChangeHandler( new ChangeHandler() {
public void onChange(ChangeEvent event) {
String attr = list.getItemText(list.getSelectedIndex());
if (attr.equals(RuleAttributeWidget.LOCK_LHS) || attr.equals(RuleAttributeWidget.LOCK_RHS)) {
model.addMetadata(new RuleMetadata(attr, "true"));
} else {
model.addAttribute(new RuleAttribute(attr, ""));
}
refreshWidget();
pop.hide();
}
});
box.setVisibleLength(15);
addbutton.setTitle(constants.AddMetadataToTheRule());
addbutton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
model.addMetadata(new RuleMetadata(box.getText(), ""));
refreshWidget();
pop.hide();
}
});
DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
horiz.add(box);
horiz.add(addbutton);
pop.addAttribute(constants.Metadata3(), horiz);
pop.addAttribute(constants.Attribute1(), list);
Button freezeConditions = new Button(constants.Conditions());
freezeConditions.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
model.addMetadata(new RuleMetadata(RuleAttributeWidget.LOCK_LHS, "true"));
refreshWidget();
pop.hide();
}
});
Button freezeActions = new Button(constants.Actions());
freezeActions.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
model.addMetadata(new RuleMetadata(RuleAttributeWidget.LOCK_RHS, "true"));
refreshWidget();
pop.hide();
}
});
HorizontalPanel hz = new HorizontalPanel();