Search in sources :

Example 81 with HTML

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

the class CompositeFactPatternWidget method doLayout.

protected void doLayout() {
    this.layout.setWidget(0, 0, getCompositeLabel());
    this.layout.getFlexCellFormatter().setColSpan(0, 0, 2);
    // this.layout.getFlexCellFormatter().setWidth(0, 0, "15%");
    this.layout.setWidget(1, 0, new HTML("    "));
    if (this.pattern.getPatterns() != null) {
        DirtyableVerticalPane vert = new DirtyableVerticalPane();
        IFactPattern[] facts = pattern.getPatterns();
        for (int i = 0; i < facts.length; i++) {
            RuleModellerWidget widget = this.getModeller().getWidgetFactory().getWidget(this.getModeller(), this.getEventBus(), facts[i], this.readOnly);
            widget.addOnModifiedCommand(new Command() {

                public void execute() {
                    setModified(true);
                }
            });
            // Wrap widget so the Fact pattern can be deleted
            vert.add(wrapLHSWidget(pattern, i, widget));
            vert.add(spacerWidget());
        }
        this.layout.setWidget(1, 1, vert);
    }
}
Also used : Command(com.google.gwt.user.client.Command) DirtyableVerticalPane(org.uberfire.ext.widgets.common.client.common.DirtyableVerticalPane) HTML(com.google.gwt.user.client.ui.HTML) IFactPattern(org.drools.workbench.models.datamodel.rule.IFactPattern)

Example 82 with HTML

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

the class ConstraintValueEditor method expressionEditor.

private Widget expressionEditor() {
    ExpressionBuilder builder = null;
    builder = new ExpressionBuilder(this.modeller, this.eventBus, this.constraint.getExpressionValue(), this.readOnly);
    builder.addOnModifiedCommand(new Command() {

        public void execute() {
            executeOnValueChangeCommand();
        }
    });
    Widget ed = widgets(new HTML("&nbsp;"), builder);
    return ed;
}
Also used : Command(com.google.gwt.user.client.Command) IsWidget(com.google.gwt.user.client.ui.IsWidget) Widget(com.google.gwt.user.client.ui.Widget) HTML(com.google.gwt.user.client.ui.HTML) ExpressionBuilder(org.drools.workbench.screens.guided.rule.client.widget.ExpressionBuilder)

Example 83 with HTML

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

the class MethodParameterValueEditor method addBoundVariableButton.

private void addBoundVariableButton(final FormStylePopup form) {
    form.addRow(new HTML("<hr/>"));
    form.addRow(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.AdvancedSection()));
    Button variableButton = new Button(GuidedRuleEditorResources.CONSTANTS.BoundVariable());
    form.addAttribute(GuidedRuleEditorResources.CONSTANTS.BoundVariable() + ":", variableButton);
    variableButton.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            methodParameter.setNature(FieldNatureType.TYPE_VARIABLE);
            methodParameter.setValue("=");
            refresh();
            form.hide();
        }
    });
}
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) HTML(com.google.gwt.user.client.ui.HTML)

Example 84 with HTML

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

the class RuleModellerActionSelectorPopup method getContent.

@Override
public Widget getContent() {
    if (position == null) {
        positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Bottom(), String.valueOf(this.model.rhs.length));
        positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Top(), "0");
        for (int i = 1; i < model.rhs.length; i++) {
            positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Line0(i), String.valueOf(i));
        }
    } else {
        // if position is fixed, we just add one element to the drop down.
        positionCbo.addItem(String.valueOf(position));
        positionCbo.setSelectedIndex(0);
    }
    if (oracle.getDSLConditions().size() == 0 && oracle.getFactTypes().length == 0) {
        layoutPanel.addRow(new HTML("<div class='highlight'>" + GuidedRuleEditorResources.CONSTANTS.NoModelTip() + "</div>"));
    }
    // only show the drop down if we are not using fixed position.
    if (position == null) {
        HorizontalPanel hp0 = new HorizontalPanel();
        hp0.add(new HTML(GuidedRuleEditorResources.CONSTANTS.PositionColon()));
        hp0.add(positionCbo);
        hp0.add(new InfoPopup(GuidedRuleEditorResources.CONSTANTS.PositionColon(), GuidedRuleEditorResources.CONSTANTS.ActionPositionExplanation()));
        layoutPanel.addRow(hp0);
        layoutPanel.addRow(new HTML("<hr/>"));
    }
    // Add a widget to filter DSLs if applicable
    final RuleModellerSelectorFilter filterWidget = GWT.create(RuleModellerSelectorFilter.class);
    filterWidget.setFilterChangeConsumer((filter) -> choicesPanel.setWidget(makeChoicesListBox(filter)));
    layoutPanel.add(filterWidget);
    choices = makeChoicesListBox(filterWidget.getFilterText());
    choicesPanel.add(choices);
    layoutPanel.addRow(choicesPanel);
    // DSL might be prohibited (e.g. editing a DRL file. Only DSLR files can contain DSL)
    if (ruleModeller.isDSLEnabled()) {
        CheckBox chkOnlyDisplayDSLConditions = new CheckBox();
        chkOnlyDisplayDSLConditions.setText(GuidedRuleEditorResources.CONSTANTS.OnlyDisplayDSLActions());
        chkOnlyDisplayDSLConditions.setValue(onlyShowDSLStatements);
        chkOnlyDisplayDSLConditions.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

            public void onValueChange(ValueChangeEvent<Boolean> event) {
                onlyShowDSLStatements = event.getValue();
                choicesPanel.setWidget(makeChoicesListBox(filterWidget.getFilterText()));
            }
        });
        layoutPanel.addRow(chkOnlyDisplayDSLConditions);
    }
    return layoutPanel;
}
Also used : CheckBox(org.gwtbootstrap3.client.ui.CheckBox) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) HTML(com.google.gwt.user.client.ui.HTML) InfoPopup(org.uberfire.ext.widgets.common.client.common.InfoPopup)

Example 85 with HTML

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

the class FromEntryPointFactPatternWidget method getCompositeLabel.

@Override
protected Widget getCompositeLabel() {
    ClickHandler click = new ClickHandler() {

        public void onClick(ClickEvent event) {
            showFactTypeSelector();
        }
    };
    String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName("from entry-point") + "</div>";
    FlexTable panel = new FlexTable();
    int r = 0;
    if (pattern.getFactPattern() == null) {
        panel.setWidget(r, 0, new ClickableLabel("<br> <font color='red'>" + GuidedRuleEditorResources.CONSTANTS.clickToAddPatterns() + "</font>", click, !this.readOnly));
        r++;
    }
    panel.setWidget(r, 0, new HTML(lbl));
    this.txtEntryPoint = new TextBox();
    this.txtEntryPoint.setText(getFromEntryPointPattern().getEntryPointName());
    this.txtEntryPoint.addChangeHandler(new ChangeHandler() {

        public void onChange(ChangeEvent event) {
            getFromEntryPointPattern().setEntryPointName(txtEntryPoint.getText());
            setModified(true);
        }
    });
    panel.setWidget(r, 1, this.txtEntryPoint);
    return panel;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlexTable(com.google.gwt.user.client.ui.FlexTable) ClickableLabel(org.uberfire.ext.widgets.common.client.common.ClickableLabel) HTML(com.google.gwt.user.client.ui.HTML) TextBox(org.gwtbootstrap3.client.ui.TextBox)

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