use of org.gwtbootstrap3.client.ui.InputGroup in project drools-wb by kiegroup.
the class ExpressionBuilder method showBindingPopUp.
private void showBindingPopUp() {
final FormStylePopup popup = new FormStylePopup(GuidedRuleEditorResources.CONSTANTS.ExpressionEditor());
final TextBox varName = new TextBox();
if (expression.isBound()) {
varName.setText(expression.getBinding());
}
popup.addAttribute(GuidedRuleEditorResources.CONSTANTS.BindTheExpressionToAVariable(), new InputGroup() {
{
add(varName);
add(new InputGroupButton() {
{
add(new Button(HumanReadableConstants.INSTANCE.Set()) {
{
addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
String var = varName.getText();
if (getModeller().isVariableNameUsed(var)) {
Window.alert(GuidedRuleEditorResources.CONSTANTS.TheVariableName0IsAlreadyTaken(var));
return;
}
expression.setBinding(var);
getModeller().refreshWidget();
popup.hide();
}
});
}
});
}
});
}
});
popup.show();
}
Aggregations