Search in sources :

Example 76 with HTML

use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.

the class MethodParameterCallValueEditor method showTypeChoice.

protected void showTypeChoice(final Widget w) {
    final FormStylePopup form = new FormStylePopup(TestScenarioAltedImages.INSTANCE.Wizard(), TestScenarioConstants.INSTANCE.FieldValue());
    Button lit = new Button(TestScenarioConstants.INSTANCE.LiteralValue());
    lit.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            methodParameter.nature = FieldData.TYPE_LITERAL;
            methodParameter.value = " ";
            refresh();
            form.hide();
        }
    });
    form.addAttribute(TestScenarioConstants.INSTANCE.LiteralValue() + ":", widgets(lit, new InfoPopup(TestScenarioConstants.INSTANCE.Literal(), TestScenarioConstants.INSTANCE.LiteralValTip())));
    form.addRow(new HTML("<hr/>"));
    form.addRow(new SmallLabel(TestScenarioConstants.INSTANCE.AdvancedSection()));
    /*
         * If there is a bound variable that is the same type of the current
         * variable type, then show a button
         */
    List<String> vars = model.getFactNamesInScope(ex, true);
    for (String v : vars) {
        boolean createButton = false;
        Button variable = new Button(TestScenarioConstants.INSTANCE.BoundVariable());
        FactData factData = (FactData) model.getFactTypes().get(v);
        if (factData.getType().equals(this.parameterType)) {
            createButton = true;
        }
        if (createButton == true) {
            form.addAttribute(TestScenarioConstants.INSTANCE.BoundVariable() + ":", variable);
            variable.addClickHandler(new ClickHandler() {

                public void onClick(ClickEvent event) {
                    methodParameter.nature = FieldData.TYPE_VARIABLE;
                    methodParameter.value = "=";
                    refresh();
                    form.hide();
                }
            });
            break;
        }
    }
    form.show();
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(org.gwtbootstrap3.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FactData(org.drools.workbench.models.testscenarios.shared.FactData) FormStylePopup(org.uberfire.ext.widgets.common.client.common.popups.FormStylePopup) HTML(com.google.gwt.user.client.ui.HTML) InfoPopup(org.uberfire.ext.widgets.common.client.common.InfoPopup)

Example 77 with HTML

use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.

the class ActionValueEditor method choice.

private Widget choice() {
    if (this.readOnly) {
        return new HTML();
    } else {
        Image clickme = GuidedRuleEditorImages508.INSTANCE.Edit();
        clickme.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                showTypeChoice();
            }
        });
        return clickme;
    }
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HTML(com.google.gwt.user.client.ui.HTML) Image(com.google.gwt.user.client.ui.Image)

Example 78 with HTML

use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.

the class MethodParameterValueEditor method showTypeChoice.

protected void showTypeChoice() {
    final FormStylePopup form = new FormStylePopup(GuidedRuleEditorImages508.INSTANCE.Wizard(), GuidedRuleEditorResources.CONSTANTS.FieldValue());
    // Literal values
    Button lit = new Button(GuidedRuleEditorResources.CONSTANTS.LiteralValue());
    lit.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            methodParameter.setNature(FieldNatureType.TYPE_LITERAL);
            methodParameter.setValue("");
            refresh();
            form.hide();
        }
    });
    form.addAttributeWithHelp(GuidedRuleEditorResources.CONSTANTS.LiteralValue(), GuidedRuleEditorResources.CONSTANTS.LiteralValue(), GuidedRuleEditorResources.CONSTANTS.LiteralValTip(), lit);
    if (modeller.isTemplate()) {
        Button templateButton = new Button(GuidedRuleEditorResources.CONSTANTS.TemplateKey());
        templateButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                methodParameter.setNature(FieldNatureType.TYPE_TEMPLATE);
                methodParameter.setValue("");
                refresh();
                form.hide();
            }
        });
        form.addAttributeWithHelp(GuidedRuleEditorResources.CONSTANTS.TemplateKey(), GuidedRuleEditorResources.CONSTANTS.TemplateKey(), GuidedRuleEditorResources.CONSTANTS.TemplateKeyTip(), templateButton);
    }
    canTheVariableButtonBeShown(new Callback<Boolean>() {

        @Override
        public void callback(Boolean result) {
            if (result) {
                addBoundVariableButton(form);
                form.addRow(new HTML("<hr/>"));
                form.addRow(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.AdvancedSection()));
            }
            // Formulas
            Button formula = new Button(GuidedRuleEditorResources.CONSTANTS.NewFormula());
            formula.addClickHandler(new ClickHandler() {

                public void onClick(ClickEvent event) {
                    methodParameter.setNature(FieldNatureType.TYPE_FORMULA);
                    refresh();
                    form.hide();
                }
            });
            form.addAttributeWithHelp(GuidedRuleEditorResources.CONSTANTS.AFormula(), GuidedRuleEditorResources.CONSTANTS.AFormula(), GuidedRuleEditorResources.CONSTANTS.FormulaExpressionTip(), formula);
            form.show();
        }
    });
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(org.gwtbootstrap3.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FormStylePopup(org.uberfire.ext.widgets.common.client.common.popups.FormStylePopup) HTML(com.google.gwt.user.client.ui.HTML)

Example 79 with HTML

use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.

the class RuleModeller method spacerWidget.

private HTML spacerWidget() {
    // NON-NLS
    HTML h = new HTML("&nbsp;");
    // NON-NLS
    h.setHeight("2px");
    return h;
}
Also used : HTML(com.google.gwt.user.client.ui.HTML)

Example 80 with HTML

use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.

the class RuleModeller method wrapLineNumber.

private Widget wrapLineNumber(int number, boolean isLHSLine) {
    String id = "rhsLine";
    if (isLHSLine) {
        id = "lhsLine";
    }
    id += number;
    DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
    horiz.add(new HTML("<div class='form-field' id='" + id + "'>" + number + ".</div>"));
    return horiz;
}
Also used : DirtyableHorizontalPane(org.uberfire.ext.widgets.common.client.common.DirtyableHorizontalPane) HTML(com.google.gwt.user.client.ui.HTML)

Aggregations

HTML (com.google.gwt.user.client.ui.HTML)170 ViewerPanel (org.cesiumjs.cs.widgets.ViewerPanel)34 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)32 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)31 Confirm (cz.metacentrum.perun.webgui.widgets.Confirm)26 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)21 FlexTable (com.google.gwt.user.client.ui.FlexTable)17 JSONString (com.google.gwt.json.client.JSONString)16 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)14 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)14 Label (com.google.gwt.user.client.ui.Label)14 AbsolutePanel (com.google.gwt.user.client.ui.AbsolutePanel)13 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)12 Image (com.google.gwt.user.client.ui.Image)11 Widget (com.google.gwt.user.client.ui.Widget)11 ViewerOptions (org.cesiumjs.cs.widgets.options.ViewerOptions)11 Button (org.gwtbootstrap3.client.ui.Button)11 ListBox (com.google.gwt.user.client.ui.ListBox)10 ArrayList (java.util.ArrayList)10 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)10