Package org.drools.workbench.screens.guided.rule.client.editor

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


            this.getDataModelOracle().getConnectiveOperatorCompletions( factType,
                                                                        fieldName,
                                                                        new Callback<String[]>() {
                                                                            @Override
                                                                            public void callback( final String[] operators ) {
                                                                                final 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


                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

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

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

                                                                             public void onValueChange(ValueChangeEvent<OperatorSelection> event) {
                                                                                 onDropDownValueChanged(event, constraint, inner, row, col);
                                                                             }
                                                                         });
View Full Code Here

            this.getDataModelOracle().getConnectiveOperatorCompletions( factType,
                                                                        fieldName,
                                                                        new Callback<String[]>() {
                                                                            @Override
                                                                            public void callback( final String[] operators ) {
                                                                                final 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

        }

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

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

        box.addItem( GuidedDecisionTableConstants.INSTANCE.noOperator(),
                     "" );
        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

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

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

                                                                             public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
                                                                                 onDropDownValueChanged( event, constraint, inner, row, col );
                                                                             }
                                                                         } );
View Full Code Here

TOP

Related Classes of org.drools.workbench.screens.guided.rule.client.editor.CEPOperatorsDropdown

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.