Examples of CEPOperatorsDropdown


Examples of org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.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.guvnor.client.asseteditor.drools.modeldriven.ui.CEPOperatorsDropdown

        }

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

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

        box.addItem( Constants.INSTANCE.noOperator(),
                     "" );
        pop.addAttribute( Constants.INSTANCE.Operator(),
                          box );
        Button b = new Button( Constants.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.guvnor.client.asseteditor.drools.modeldriven.ui.CEPOperatorsDropdown

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

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

                criteriaExtendedEntry.setVisible( presenter.getTableFormat() == TableFormat.EXTENDED_ENTRY );
                criteriaLimitedEntry.setVisible( presenter.getTableFormat() == 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>() {

                            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>() {

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

Examples of org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.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.guvnor.client.asseteditor.drools.modeldriven.ui.CEPOperatorsDropdown

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

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

                criteriaExtendedEntry.setVisible( presenter.getTableFormat() == TableFormat.EXTENDED_ENTRY );
                criteriaLimitedEntry.setVisible( presenter.getTableFormat() == 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>() {

                            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>() {

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

Examples of org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.CEPOperatorsDropdown

        }

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

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

        box.addItem( Constants.INSTANCE.noOperator(),
                     "" );
        pop.addAttribute( Constants.INSTANCE.Operator(),
                          box );
        Button b = new Button( Constants.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.guvnor.client.modeldriven.ui.CEPOperatorsDropdown

        final FormStylePopup pop = new FormStylePopup();
        pop.setTitle( constants.SetTheOperator() );
        pop.setModal( false );
        String[] ops = this.sce.getOperatorCompletions( editingPattern.getFactType(),
                                                        editingCol.getFactField() );
        final CEPOperatorsDropdown box = new CEPOperatorsDropdown( ops,
                                                                   editingCol );

        if ( BaseSingleFieldConstraint.TYPE_LITERAL == this.editingCol
                .getConstraintValueType() ) {
            box.addItem( HumanReadable.getOperatorDisplayName( "in" ),
                         "in" );
        }

        box.addItem( constants.noOperator(),
                     "" );
        pop.addAttribute( constants.Operator(),
                          box );
        Button b = new Button( constants.OK() );
        pop.addAttribute( "",
                          b );
        b.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent w) {
                editingCol.setOperator( box.getValue( box.getSelectedIndex() ) );
                doOperatorLabel();
                pop.hide();
            }
        } );
        pop.show();
View Full Code Here

Examples of org.drools.guvnor.client.modeldriven.ui.CEPOperatorsDropdown

        if ( !isReadOnly ) {
            String factType = this.pattern.getFactType();
            String[] operators = this.getCompletions().getConnectiveOperatorCompletions( factType,
                                                                                         fieldName );
            CEPOperatorsDropdown w = new CEPOperatorsDropdown( operators,
                                                               con );

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

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

Examples of org.drools.guvnor.client.modeldriven.ui.CEPOperatorsDropdown

        final FormStylePopup pop = new FormStylePopup();
        pop.setTitle( constants.SetTheOperator() );
        pop.setModal( false );
        String[] ops = this.sce.getOperatorCompletions( editingPattern.getFactType(),
                                                        editingCol.getFactField() );
        final CEPOperatorsDropdown box = new CEPOperatorsDropdown( ops,
                                                                   editingCol );

        if ( BaseSingleFieldConstraint.TYPE_LITERAL == this.editingCol
                .getConstraintValueType() ) {
            box.addItem( HumanReadable.getOperatorDisplayName( "in" ),
                         "in" );
        }

        box.addItem( constants.noOperator(),
                     "" );
        pop.addAttribute( constants.Operator(),
                          box );
        Button b = new Button( constants.OK() );
        pop.addAttribute( "",
                          b );
        b.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent w) {
                editingCol.setOperator( box.getValue( box.getSelectedIndex() ) );
                doOperatorLabel();
                pop.hide();
            }
        } );
        pop.show();
View Full Code Here

Examples of org.drools.guvnor.client.modeldriven.ui.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
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.