protected String getFieldBinding( FieldConstraint fc, String var ) { String fieldType = null; if ( fc instanceof SingleFieldConstraint ) { SingleFieldConstraint s = (SingleFieldConstraint) fc; if ( s.isBound() && var.equals( s.getFieldBinding() ) ) { fieldType = s.getFieldType(); } } if ( fc instanceof SingleFieldConstraintEBLeftSide ) { SingleFieldConstraintEBLeftSide s = (SingleFieldConstraintEBLeftSide) fc; if ( s.isBound() && var.equals( s.getFieldBinding() ) ) { fieldType = s.getExpressionLeftSide().getGenericType(); } } if ( fc instanceof CompositeFieldConstraint ) { CompositeFieldConstraint s = (CompositeFieldConstraint) fc; if ( s.getConstraints() != null ) { for ( FieldConstraint ss : s.getConstraints() ) { fieldType = getFieldBinding( ss, var ); } } } return fieldType; }
private HorizontalPanel expressionBuilderLS( final SingleFieldConstraintEBLeftSide con, boolean showBinding, int padding ) { 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 { ab.add( new SmallLabel( con.getExpressionLeftSide().getText() ) ); } } else { ab.add( new ExpressionBuilder( getModeller(), getEventBus(), con.getExpressionLeftSide() ) ); } return ab; }