Search in sources :

Example 1 with DRLConstraintValueBuilder

use of org.drools.workbench.models.datamodel.rule.builder.DRLConstraintValueBuilder 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)

Aggregations

HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)1 DRLConstraintValueBuilder (org.drools.workbench.models.datamodel.rule.builder.DRLConstraintValueBuilder)1 ToStringExpressionVisitor (org.drools.workbench.models.datamodel.rule.visitors.ToStringExpressionVisitor)1 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)1