Search in sources :

Example 71 with HorizontalPanel

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

the class Connectives method connectives.

public Widget connectives(final SingleFieldConstraint c) {
    final HorizontalPanel hp = new HorizontalPanel();
    if (c.getConnectives() != null && c.getConnectives().length > 0) {
        hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        for (int i = 0; i < c.getConnectives().length; i++) {
            final int index = i;
            final ConnectiveConstraint con = c.getConnectives()[i];
            connectiveOperatorDropDown(con, new Callback<Widget>() {

                @Override
                public void callback(final Widget w) {
                    hp.add(w);
                    hp.add(connectiveValueEditor(con));
                    if (!isReadOnly) {
                        Image clear = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
                        clear.setAltText(GuidedRuleEditorResources.CONSTANTS.RemoveThisRestriction());
                        clear.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveThisRestriction());
                        clear.addClickHandler(createClickHandlerForClearImageButton(c, index));
                        hp.add(clear);
                    }
                }
            });
        }
    }
    return hp;
}
Also used : HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Widget(com.google.gwt.user.client.ui.Widget) ConnectiveConstraint(org.drools.workbench.models.datamodel.rule.ConnectiveConstraint) Image(com.google.gwt.user.client.ui.Image) ConnectiveConstraint(org.drools.workbench.models.datamodel.rule.ConnectiveConstraint) SingleFieldConstraint(org.drools.workbench.models.datamodel.rule.SingleFieldConstraint) BaseSingleFieldConstraint(org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)

Example 72 with HorizontalPanel

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

the class ActionCallMethodWidget method getSetterLabel.

private Widget getSetterLabel() {
    HorizontalPanel horiz = new HorizontalPanel();
    if (model.getState() == ActionCallMethod.TYPE_UNDEFINED) {
        Image edit = GuidedRuleEditorImages508.INSTANCE.AddFieldToFact();
        edit.setAltText(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue());
        edit.setTitle(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue());
        edit.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                Widget w = (Widget) event.getSource();
                showAddFieldPopup(w);
            }
        });
        // NON-NLS
        horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "]"));
        if (!this.readOnly) {
            horiz.add(edit);
        }
    } else {
        // NON-NLS
        horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "." + model.getMethodName() + "]"));
    }
    return horiz;
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Widget(com.google.gwt.user.client.ui.Widget) Image(com.google.gwt.user.client.ui.Image)

Example 73 with HorizontalPanel

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

the class FactPatternWidget method expressionBuilderLS.

private HorizontalPanel expressionBuilderLS(final SingleFieldConstraintEBLeftSide con, boolean showBinding) {
    HorizontalPanel ab = new HorizontalPanel();
    ab.setStyleName("modeller-field-Label");
    if (!con.isBound()) {
        if (bindable && showBinding && !this.readOnly) {
            ab.add(new ExpressionBuilder(getModeller(), getEventBus(), con.getExpressionLeftSide()));
        } else {
            final DRLConstraintValueBuilder constraintValueBuilder = DRLConstraintValueBuilder.getBuilder(getRuleDialect());
            final ToStringExpressionVisitor visitor = new ToStringExpressionVisitor(constraintValueBuilder);
            ab.add(new SmallLabel(con.getExpressionLeftSide().getText(visitor)));
        }
    } else {
        ab.add(new ExpressionBuilder(getModeller(), getEventBus(), con.getExpressionLeftSide()));
    }
    return ab;
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) DRLConstraintValueBuilder(org.drools.workbench.models.datamodel.rule.builder.DRLConstraintValueBuilder) ToStringExpressionVisitor(org.drools.workbench.models.datamodel.rule.visitors.ToStringExpressionVisitor)

Example 74 with HorizontalPanel

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

the class MethodParameterCallValueEditor method widgets.

private Widget widgets(final Button lit, final InfoPopup popup) {
    HorizontalPanel h = new HorizontalPanel();
    h.add(lit);
    h.add(popup);
    return h;
}
Also used : HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel)

Example 75 with HorizontalPanel

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

the class TypeChoiceFormPopup method widgets.

private Panel widgets(final IsWidget left, final IsWidget right) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.add(left);
    panel.add(right);
    panel.setWidth("100%");
    return panel;
}
Also used : HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel)

Aggregations

HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)75 Label (com.google.gwt.user.client.ui.Label)25 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)24 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)21 Image (com.google.gwt.user.client.ui.Image)15 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)14 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)11 HTML (com.google.gwt.user.client.ui.HTML)8 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)7 Widget (com.google.gwt.user.client.ui.Widget)7 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)7 Button (org.gwtbootstrap3.client.ui.Button)7 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)6 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)6 TextBox (com.google.gwt.user.client.ui.TextBox)6 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 TextBox (org.gwtbootstrap3.client.ui.TextBox)5 InfoPopup (org.uberfire.ext.widgets.common.client.common.InfoPopup)5 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)4