Search in sources :

Example 1 with ToStringExpressionVisitor

use of org.drools.workbench.models.datamodel.rule.visitors.ToStringExpressionVisitor in project drools by kiegroup.

the class GeneratorContextRuleModelVisitor method visitFromCompositeFactPattern.

private void visitFromCompositeFactPattern(final FromCompositeFactPattern pattern) {
    visit(pattern.getFactPattern());
    ToStringExpressionVisitor visitor = new ToStringExpressionVisitor();
    parseStringPattern(pattern.getExpression().getText(visitor));
}
Also used : ToStringExpressionVisitor(org.drools.workbench.models.datamodel.rule.visitors.ToStringExpressionVisitor)

Example 2 with ToStringExpressionVisitor

use of org.drools.workbench.models.datamodel.rule.visitors.ToStringExpressionVisitor 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

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