Examples of CEPOperatorsDropdown


Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

            String factType = cc.getFactType();
            String fieldName = cc.getFieldName();

            String[] operators = this.getCompletions().getConnectiveOperatorCompletions( factType,
                                                                                         fieldName );
            CEPOperatorsDropdown w = new CEPOperatorsDropdown( operators,
                                                               cc );

            w.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                    OperatorSelection selection = event.getValue();
                    String selected = selection.getValue();
                    cc.setOperator( selected );
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

                                                      }
                                                  } );
            }

            private void doPopulateConditionDefinition( final String[] ops ) {
                final CEPOperatorsDropdown ddOperator = new CEPOperatorsDropdown( ops,
                                                                                  chosenConditionsSelection );
                ddOperatorContainer.setWidget( ddOperator );

                criteriaExtendedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY );
                criteriaLimitedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.LIMITED_ENTRY );

                // Fields specific to the table format
                switch ( presenter.getTableFormat() ) {
                    case EXTENDED_ENTRY:
                        txtValueList.setEnabled( !presenter.requiresValueList( availablePatternsSelection,
                                                                               chosenConditionsSelection ) );
                        txtValueList.setText( chosenConditionsSelection.getValueList() );

                        makeDefaultValueWidget();
                        defaultValueContainer.setVisible( validator.doesOperatorNeedValue( chosenConditionsSelection ) );

                        if ( chosenConditionsSelection.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ) {
                            txtPredicateExpression.setText( chosenConditionsSelection.getFactField() );
                        }

                        ddOperator.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                            @Override
                            public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                                chosenConditionsSelection.setOperator( event.getValue().getValue() );
                                final boolean requiresValueList = presenter.requiresValueList( availablePatternsSelection,
                                                                                               chosenConditionsSelection );
                                txtValueList.setEnabled( requiresValueList );
                                if ( !requiresValueList ) {
                                    txtValueList.setText( "" );
                                }
                                presenter.stateChanged();
                                validateConditionOperator();

                                makeDefaultValueWidget();
                                defaultValueContainer.setVisible( validator.doesOperatorNeedValue( chosenConditionsSelection ) );
                            }

                        } );

                        switch ( chosenConditionsSelection.getConstraintValueType() ) {
                            case BaseSingleFieldConstraint.TYPE_LITERAL:
                                optLiteral.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                                break;
                            case BaseSingleFieldConstraint.TYPE_RET_VALUE:
                                optFormula.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                                break;
                            case BaseSingleFieldConstraint.TYPE_PREDICATE:
                                optPredicate.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                        }
                        break;
                    case LIMITED_ENTRY:
                        calculationType.setVisible( false );
                        makeLimitedValueWidget();

                        // If operator changes the widget used to populate the
                        // value can change
                        ddOperator.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                            @Override
                            public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                                chosenConditionsSelection.setOperator( event.getValue().getValue() );
                                validateConditionOperator();
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

        }

        final String[] displayOps = new String[ filteredOps.size() ];
        filteredOps.toArray( displayOps );

        final CEPOperatorsDropdown box = new CEPOperatorsDropdown( displayOps,
                                                                   editingCol );

        box.insertItem( GuidedDecisionTableConstants.INSTANCE.noOperator(),
                        "",
                        1 );
        pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Operator(),
                          box );
        Button b = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
        pop.addAttribute( "",
                          b );
        b.addClickHandler( new ClickHandler() {
            public void onClick( ClickEvent w ) {
                editingCol.setOperator( box.getValue( box.getSelectedIndex() ) );
                makeLimitedValueWidget();
                makeDefaultValueWidget();
                doOperatorLabel();
                doValueList();
                pop.hide();
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

            String factType = cc.getFactType();
            String fieldName = cc.getFieldName();

            String[] operators = this.getCompletions().getConnectiveOperatorCompletions( factType,
                                                                                         fieldName );
            CEPOperatorsDropdown w = new CEPOperatorsDropdown( operators,
                                                               cc );

            w.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                    OperatorSelection selection = event.getValue();
                    String selected = selection.getValue();
                    cc.setOperator( selected );
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

                fieldName = c.getFieldName();
            }

            String[] operators = connectives.getCompletions().getOperatorCompletions( factType,
                                                                                      fieldName );
            CEPOperatorsDropdown w = new CEPOperatorsDropdown( operators,
                                                               c );

            w.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                    setModified( true );
                    final OperatorSelection selection = event.getValue();
                    final String selected = selection.getValue();
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

            connectives.getDataModelOracle().getOperatorCompletions( factType,
                                                                     fieldName,
                                                                     new Callback<String[]>() {
                                                                         @Override
                                                                         public void callback( final String[] operators ) {
                                                                             CEPOperatorsDropdown w = new CEPOperatorsDropdown( operators,
                                                                                                                                c );
                                                                             hp.add( w );

                                                                             w.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                                                                                 public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                                                                                     setModified( true );
                                                                                     final OperatorSelection selection = event.getValue();
                                                                                     final String selected = selection.getValue();
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

                txtColumnHeader.setEnabled( true );
                txtColumnHeader.setText( chosenConditionsSelection.getHeader() );

                final String[] ops = presenter.getOperatorCompletions( availablePatternsSelection,
                                                                       chosenConditionsSelection );
                final CEPOperatorsDropdown ddOperator = new CEPOperatorsDropdown( ops,
                                                                                  chosenConditionsSelection );
                ddOperatorContainer.setWidget( ddOperator );

                criteriaExtendedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY );
                criteriaLimitedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.LIMITED_ENTRY );

                // Fields specific to the table format
                switch ( presenter.getTableFormat() ) {
                    case EXTENDED_ENTRY:
                        txtValueList.setEnabled( !presenter.requiresValueList( availablePatternsSelection,
                                                                               chosenConditionsSelection ) );
                        txtValueList.setText( chosenConditionsSelection.getValueList() );

                        makeDefaultValueWidget();
                        defaultValueContainer.setVisible( validator.doesOperatorNeedValue( chosenConditionsSelection ) );

                        if ( chosenConditionsSelection.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ) {
                            txtPredicateExpression.setText( chosenConditionsSelection.getFactField() );
                        }

                        ddOperator.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                            @Override
                            public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                                chosenConditionsSelection.setOperator( event.getValue().getValue() );
                                final boolean requiresValueList = presenter.requiresValueList( availablePatternsSelection,
                                                                                               chosenConditionsSelection );
                                txtValueList.setEnabled( requiresValueList );
                                if ( !requiresValueList ) {
                                    txtValueList.setText( "" );
                                }
                                presenter.stateChanged();
                                validateConditionOperator();

                                makeDefaultValueWidget();
                                defaultValueContainer.setVisible( validator.doesOperatorNeedValue( chosenConditionsSelection ) );
                            }

                        } );

                        switch ( chosenConditionsSelection.getConstraintValueType() ) {
                            case BaseSingleFieldConstraint.TYPE_LITERAL:
                                optLiteral.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                                break;
                            case BaseSingleFieldConstraint.TYPE_RET_VALUE:
                                optFormula.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                                break;
                            case BaseSingleFieldConstraint.TYPE_PREDICATE:
                                optPredicate.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                        }
                        break;
                    case LIMITED_ENTRY:
                        calculationType.setVisible( false );
                        makeLimitedValueWidget();

                        // If operator changes the widget used to populate the
                        // value can change
                        ddOperator.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                            @Override
                            public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                                chosenConditionsSelection.setOperator( event.getValue().getValue() );
                                validateConditionOperator();
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

        }

        final String[] displayOps = new String[ filteredOps.size() ];
        filteredOps.toArray( displayOps );

        final CEPOperatorsDropdown box = new CEPOperatorsDropdown( displayOps,
                                                                   editingCol );

        box.insertItem( GuidedDecisionTableConstants.INSTANCE.noOperator(),
                        "",
                        1 );
        pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Operator(),
                          box );
        Button b = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
        pop.addAttribute( "",
                          b );
        b.addClickHandler( new ClickHandler() {
            public void onClick( ClickEvent w ) {
                editingCol.setOperator( box.getValue( box.getSelectedIndex() ) );
                makeLimitedValueWidget();
                makeDefaultValueWidget();
                doOperatorLabel();
                doValueList();
                pop.hide();
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

        }

        final String[] displayOps = new String[ filteredOps.size() ];
        filteredOps.toArray( displayOps );

        final CEPOperatorsDropdown box = new CEPOperatorsDropdown( displayOps,
                                                                   editingCol );

        box.insertItem( GuidedDecisionTableConstants.INSTANCE.noOperator(),
                        "",
                        1 );
        pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Operator(),
                          box );
        Button b = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
        pop.addAttribute( "",
                          b );
        b.addClickHandler( new ClickHandler() {
            public void onClick( ClickEvent w ) {
                editingCol.setOperator( box.getValue( box.getSelectedIndex() ) );
                makeLimitedValueWidget();
                makeDefaultValueWidget();
                doOperatorLabel();
                doValueList();
                pop.hide();
View Full Code Here

Examples of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

                                                      }
                                                  } );
            }

            private void doPopulateConditionDefinition( final String[] ops ) {
                final CEPOperatorsDropdown ddOperator = new CEPOperatorsDropdown( ops,
                                                                                  chosenConditionsSelection );
                ddOperatorContainer.setWidget( ddOperator );

                criteriaExtendedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY );
                criteriaLimitedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.LIMITED_ENTRY );

                // Fields specific to the table format
                switch ( presenter.getTableFormat() ) {
                    case EXTENDED_ENTRY:
                        txtValueList.setEnabled( !presenter.requiresValueList( availablePatternsSelection,
                                                                               chosenConditionsSelection ) );
                        txtValueList.setText( chosenConditionsSelection.getValueList() );

                        makeDefaultValueWidget();
                        defaultValueContainer.setVisible( validator.doesOperatorNeedValue( chosenConditionsSelection ) );

                        if ( chosenConditionsSelection.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ) {
                            txtPredicateExpression.setText( chosenConditionsSelection.getFactField() );
                        }

                        ddOperator.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                            @Override
                            public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                                chosenConditionsSelection.setOperator( event.getValue().getValue() );
                                final boolean requiresValueList = presenter.requiresValueList( availablePatternsSelection,
                                                                                               chosenConditionsSelection );
                                txtValueList.setEnabled( requiresValueList );
                                if ( !requiresValueList ) {
                                    txtValueList.setText( "" );
                                } else {
                                    txtValueList.setText( chosenConditionsSelection.getValueList() );
                                }
                                presenter.stateChanged();
                                validateConditionOperator();

                                makeDefaultValueWidget();
                                defaultValueContainer.setVisible( validator.doesOperatorNeedValue( chosenConditionsSelection ) );
                            }

                        } );

                        switch ( chosenConditionsSelection.getConstraintValueType() ) {
                            case BaseSingleFieldConstraint.TYPE_LITERAL:
                                optLiteral.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                                break;
                            case BaseSingleFieldConstraint.TYPE_RET_VALUE:
                                optFormula.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                                break;
                            case BaseSingleFieldConstraint.TYPE_PREDICATE:
                                optPredicate.setValue( true );
                                displayCalculationTypes( availablePatternsSelection,
                                                         chosenConditionsSelection );
                        }
                        break;
                    case LIMITED_ENTRY:
                        calculationType.setVisible( false );
                        makeLimitedValueWidget();

                        // If operator changes the widget used to populate the
                        // value can change
                        ddOperator.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {

                            @Override
                            public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                                chosenConditionsSelection.setOperator( event.getValue().getValue() );
                                validateConditionOperator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.