Package org.drools.ide.common.client.modeldriven.brl

Examples of org.drools.ide.common.client.modeldriven.brl.SingleFieldConstraintEBLeftSide


    private DropDownData getDropDownData() {
        String valueType;
        String fieldName;
        if ( constraint instanceof SingleFieldConstraintEBLeftSide ) {
            SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) this.constraint;
            fieldName = sfexp.getExpressionLeftSide().getFieldName();
            valueType = sfexp.getExpressionLeftSide().getGenericType();

        } else if ( constraint instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) constraint;
            fieldName = cc.getFieldName();
            valueType = cc.getFieldType();
View Full Code Here


        this.model = modeller.getModel();
        this.modeller = modeller;
        this.readOnly = readOnly;

        if ( con instanceof SingleFieldConstraintEBLeftSide ) {
            SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) con;
            this.factType = sfexp.getExpressionLeftSide().getPreviousClassType();
            if ( this.factType == null ) {
                this.factType = sfexp.getExpressionLeftSide().getClassType();
            }
            this.fieldName = sfexp.getExpressionLeftSide().getFieldName();
            this.fieldType = sfexp.getExpressionLeftSide().getGenericType();

        } else if ( con instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            this.factType = cc.getFactType();
            this.fieldName = cc.getFieldName();
View Full Code Here

        //Expressions' fieldName and hence fieldType can change without creating a new ConstraintValueEditor.
        //SingleFieldConstraints and their ConnectiveConstraints cannot have the fieldName or fieldType changed
        //without first deleting and re-creating.
        if ( this.constraint instanceof SingleFieldConstraintEBLeftSide ) {
            SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) this.constraint;
            this.fieldName = sfexp.getExpressionLeftSide().getFieldName();
            this.fieldType = sfexp.getExpressionLeftSide().getGenericType();
        }

        //Set applicable flags and reference data depending upon type
        this.isNumeric = SuggestionCompletionEngine.TYPE_NUMERIC.equals( this.fieldType );
        if ( SuggestionCompletionEngine.TYPE_BOOLEAN.equals( this.fieldType ) ) {
View Full Code Here

            String fieldName;
            String factType;

            //Connectives Operators are handled in class Connectives
            if ( c instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) c;
                factType = sfexp.getExpressionLeftSide().getPreviousClassType();
                if ( factType == null ) {
                    factType = sfexp.getExpressionLeftSide().getClassType();
                }
                fieldName = sfexp.getExpressionLeftSide().getFieldName();

            } else {
                factType = c.getFactType();
                fieldName = c.getFieldName();
            }
View Full Code Here

                    HasParameterizedOperator hop = (HasParameterizedOperator) constr;
                    parameters = hop.getParameters();
                }

                if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                    SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) constr;
                    addFieldRestriction( buf,
                                         sfexp.getConstraintValueType(),
                                         sfexp.getExpressionLeftSide().getGenericType(),
                                         sfexp.getOperator(),
                                         parameters,
                                         sfexp.getValue(),
                                         sfexp.getExpressionValue() );
                } else {
                    addFieldRestriction( buf,
                                         constr.getConstraintValueType(),
                                         constr.getFieldType(),
                                         constr.getOperator(),
View Full Code Here

            Button ebBtn = new Button( constants.ExpressionEditor() );

            ebBtn.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent event) {
                    SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide();
                    con.setConstraintValueType( SingleFieldConstraint.TYPE_UNDEFINED );
                    pattern.addConstraint( con );
                    con.setExpressionLeftSide( new ExpressionFormLine( new ExpressionUnboundFact( pattern ) ) );
                    modeller.refreshWidget();
                    popup.hide();
                }
            } );
            popup.addAttribute( constants.ExpressionEditor(),
View Full Code Here

            String fieldName;
            String factType;

            //Connectives Operators are handled in class Connectives
            if ( c instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) c;
                factType = sfexp.getExpressionLeftSide().getPreviousGenericType();
                if ( factType == null ) {
                    factType = sfexp.getExpressionLeftSide().getGenericType();
                }
                fieldName = sfexp.getExpressionLeftSide().getFieldName();

            } else {
                factType = c.getFactType();
                fieldName = c.getFieldName();
            }
View Full Code Here

        this.readOnly = readOnly;

        this.panel = new SimplePanel();

        if ( con instanceof SingleFieldConstraintEBLeftSide ) {
            SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) con;
            this.factType = sfexp.getExpressionLeftSide().getPreviousGenericType();
            if ( this.factType == null ) {
                this.factType = sfexp.getExpressionLeftSide().getGenericType();
            }
            this.fieldName = sfexp.getExpressionLeftSide().getFieldName();
            this.fieldType = sfexp.getExpressionLeftSide().getGenericType();

        } else if ( con instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            this.factType = cc.getFactType();
            this.fieldName = cc.getFieldName();
View Full Code Here

        //Expressions' fieldName and hence fieldType can change without creating a new ConstraintValueEditor.
        //SingleFieldConstraints and their ConnectiveConstraints cannot have the fieldName or fieldType changed
        //without first deleting and re-creating.
        if ( this.constraint instanceof SingleFieldConstraintEBLeftSide ) {
            SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) this.constraint;
            this.factType = sfexp.getExpressionLeftSide().getPreviousGenericType();
            if ( this.factType == null ) {
                this.factType = sfexp.getExpressionLeftSide().getGenericType();
            }
            this.fieldName = sfexp.getExpressionLeftSide().getFieldName();
            this.fieldType = sfexp.getExpressionLeftSide().getGenericType();
        }

        //Initialise drop-down data
        getDropDownData();
View Full Code Here

        popup.addRow( new SmallLabel( "<i>" + Constants.INSTANCE.AdvancedOptionsColon() + "</i>" ) );
        Button ebBtn = new Button( Constants.INSTANCE.ExpressionEditor() );

        ebBtn.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent event) {
                SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide();
                con.setConstraintValueType( SingleFieldConstraint.TYPE_UNDEFINED );
                con.setExpressionLeftSide( new ExpressionFormLine( new ExpressionUnboundFact( pattern ) ) );
                hasConstraints.addConstraint( con );
                modeller.refreshWidget();
                popup.hide();
            }
        } );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.SingleFieldConstraintEBLeftSide

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.