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

Examples of org.drools.ide.common.client.modeldriven.dt52.LimitedEntryConditionCol52


        Pattern52 driverPattern = new Pattern52();
        driverPattern.setBoundName("driverPattern");
        driverPattern.setFactType("Driver");

        LimitedEntryConditionCol52 child = new LimitedEntryConditionCol52();
        child.setFactField("age");
        child.setOperator("<");
        child.setValue(new DTCellValue52(new Integer("18")));
        child.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(child);

        LimitedEntryConditionCol52 pensioner = new LimitedEntryConditionCol52();
        pensioner.setFactField("age");
        pensioner.setOperator(">=");
        pensioner.setValue(new DTCellValue52(new Integer("65")));
        pensioner.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(pensioner);

        dt.getConditions().add(driverPattern);

        ActionSetFieldCol52 message = new ActionSetFieldCol52();
View Full Code Here


        Pattern52 driverPattern = new Pattern52();
        driverPattern.setBoundName("driverPattern");
        driverPattern.setFactType("Driver");

        LimitedEntryConditionCol52 child = new LimitedEntryConditionCol52();
        child.setFactField("age");
        child.setOperator("<");
        child.setValue(new DTCellValue52(new Integer("18")));
        child.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(child);

        LimitedEntryConditionCol52 adult = new LimitedEntryConditionCol52();
        adult.setFactField("age");
        adult.setOperator(">=");
        adult.setValue(new DTCellValue52(new Integer("18")));
        adult.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(adult);

        LimitedEntryConditionCol52 pensioner = new LimitedEntryConditionCol52();
        pensioner.setFactField("age");
        pensioner.setOperator(">=");
        pensioner.setValue(new DTCellValue52(new Integer("65")));
        pensioner.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(pensioner);

        dt.getConditions().add(driverPattern);

        ActionSetFieldCol52 message = new ActionSetFieldCol52();
View Full Code Here

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "c1" );
        p1.setFactType( "Driver" );

        LimitedEntryConditionCol52 c1 = new LimitedEntryConditionCol52();
        c1.setFactField( "name" );
        c1.setOperator( "==" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        c1.setValue( new DTCellValue52( "Mike" ) );
        p1.getChildColumns().add( c1 );
        dtable.getConditions().add( p1 );

        Pattern52 p2 = new Pattern52();
        p2.setBoundName( "c2" );
        p2.setFactType( "Driver" );

        LimitedEntryConditionCol52 c2 = new LimitedEntryConditionCol52();
        c2.setFactField( "age" );
        c2.setOperator( "==" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        c1.setValue( new DTCellValue52( 25 ) );
        p2.getChildColumns().add( c2 );
        dtable.getConditions().add( p2 );

        LimitedEntryActionSetFieldCol52 a1 = new LimitedEntryActionSetFieldCol52();
View Full Code Here

            }

            private ConditionCol52 makeNewConditionColumn() {
                switch ( guidedDecisionTable.getTableFormat() ) {
                    case LIMITED_ENTRY :
                        return new LimitedEntryConditionCol52();
                    default :
                        return new ConditionCol52();
                }
            }
View Full Code Here

            private void makeLimitedValueWidget() {
                if ( !(chosenConditionsSelection instanceof LimitedEntryConditionCol52) ) {
                    return;
                }
                LimitedEntryConditionCol52 lec = (LimitedEntryConditionCol52) chosenConditionsSelection;
                boolean doesOperatorNeedValue = validator.doesOperatorNeedValue( chosenConditionsSelection );
                if ( !doesOperatorNeedValue ) {
                    limitedEntryValueContainer.setVisible( false );
                    lec.setValue( null );
                    return;
                }
                limitedEntryValueContainer.setVisible( true );
                if ( lec.getValue() == null ) {
                    lec.setValue( factory.makeNewValue( chosenConditionsSelection ) );
                }
                limitedEntryValueWidgetContainer.setWidget( factory.getWidget( availablePatternsSelection,
                                                                               chosenConditionsSelection,
                                                                               lec.getValue() ) );
            }

        } );
    }
View Full Code Here

            c.setFactField( f.getName() );
            c.setFieldType( f.getType() );
            c.setConstraintValueType( f.getCalculationType() );
            return c;
        } else {
            LimitedEntryConditionCol52 c = new LimitedEntryConditionCol52();
            c.setFactField( f.getName() );
            c.setFieldType( f.getType() );
            c.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
            return c;
        }

    }
View Full Code Here

    public boolean isConditionLimitedEntryValueValid(ConditionCol52 c) {
        if ( !(c instanceof LimitedEntryConditionCol52) ) {
            return true;
        }
        LimitedEntryConditionCol52 lec = (LimitedEntryConditionCol52) c;
        boolean doesOperatorNeedValue = doesOperatorNeedValue( lec );
        boolean hasValue = hasValue( lec );
        return (doesOperatorNeedValue && hasValue) || (!doesOperatorNeedValue && !hasValue);
    }
View Full Code Here

    }

    private ConditionCol52 cloneConditionColumn(ConditionCol52 col) {
        ConditionCol52 clone = null;
        if ( col instanceof LimitedEntryConditionCol52 ) {
            clone = new LimitedEntryConditionCol52();
            DTCellValue52 dcv = cloneLimitedEntryValue( ((LimitedEntryCol) col).getValue() );
            ((LimitedEntryCol) clone).setValue( dcv );
        } else {
            clone = new ConditionCol52();
        }
View Full Code Here

    private void makeLimitedValueWidget() {
        if ( !(editingCol instanceof LimitedEntryConditionCol52) ) {
            return;
        }
        LimitedEntryConditionCol52 lec = (LimitedEntryConditionCol52) editingCol;
        boolean doesOperatorNeedValue = validator.doesOperatorNeedValue( editingCol );
        if ( !doesOperatorNeedValue ) {
            setAttributeVisibility( limitedEntryValueAttributeIndex,
                                    false );
            lec.setValue( null );
            return;
        }
        setAttributeVisibility( limitedEntryValueAttributeIndex,
                                true );
        if ( lec.getValue() == null ) {
            lec.setValue( factory.makeNewValue( editingPattern,
                                                editingCol ) );
        }
        limitedEntryValueWidgetContainer.setWidget( factory.getWidget( editingPattern,
                                                                       editingCol,
                                                                       lec.getValue() ) );
    }
View Full Code Here

            private void makeLimitedValueWidget() {
                if ( !(chosenConditionsSelection instanceof LimitedEntryConditionCol52) ) {
                    return;
                }
                LimitedEntryConditionCol52 lec = (LimitedEntryConditionCol52) chosenConditionsSelection;
                boolean doesOperatorNeedValue = validator.doesOperatorNeedValue( chosenConditionsSelection );
                if ( !doesOperatorNeedValue ) {
                    limitedEntryValueContainer.setVisible( false );
                    lec.setValue( null );
                    return;
                }
                limitedEntryValueContainer.setVisible( true );
                if ( lec.getValue() == null ) {
                    lec.setValue( factory.makeNewValue( chosenConditionsSelection ) );
                }
                limitedEntryValueWidgetContainer.setWidget( factory.getWidget( availablePatternsSelection,
                                                                               chosenConditionsSelection,
                                                                               lec.getValue() ) );
            }

        } );
    }
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.dt52.LimitedEntryConditionCol52

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.