Search in sources :

Example 1 with InputGroup

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();
}
Also used : InputGroup(org.gwtbootstrap3.client.ui.InputGroup) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) InputGroupButton(org.gwtbootstrap3.client.ui.InputGroupButton) Button(org.gwtbootstrap3.client.ui.Button) InputGroupButton(org.gwtbootstrap3.client.ui.InputGroupButton) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FormStylePopup(org.uberfire.ext.widgets.common.client.common.popups.FormStylePopup) TextBox(org.gwtbootstrap3.client.ui.TextBox)

Aggregations

ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Button (org.gwtbootstrap3.client.ui.Button)1 InputGroup (org.gwtbootstrap3.client.ui.InputGroup)1 InputGroupButton (org.gwtbootstrap3.client.ui.InputGroupButton)1 TextBox (org.gwtbootstrap3.client.ui.TextBox)1 FormStylePopup (org.uberfire.ext.widgets.common.client.common.popups.FormStylePopup)1