Package org.drools.workbench.models.guided.scorecard.shared

Examples of org.drools.workbench.models.guided.scorecard.shared.Attribute


        }
    }

    private void addAttribute( final DirtyableFlexTable selectedTable,
                               final Attribute attribute ) {
        Attribute newAttribute = null;
        if ( attribute != null ) {
            characteristicsAttrMap.get( selectedTable ).getList().add( attribute );
        } else {
            newAttribute = new Attribute();
            characteristicsAttrMap.get( selectedTable ).getList().add( newAttribute );
        }
        characteristicsAttrMap.get( selectedTable ).refresh();

        //Disable the fact & field dropdowns
        ( (ListBox) selectedTable.getWidget( 2,
                                             0 ) ).setEnabled( false );
        ( (ListBox) selectedTable.getWidget( 2,
                                             1 ) ).setEnabled( false );
        final ListBox edd = ( (ListBox) selectedTable.getWidget( 2,
                                                                 1 ) );
        if ( edd.getSelectedIndex() > -1 ) {
            String field = edd.getValue( edd.getSelectedIndex() );
            field = field.substring( field.indexOf( ":" ) + 1 ).trim();
            final CellTable<Attribute> cellTable = (CellTable<Attribute>) characteristicsAttrMap.get( selectedTable ).getDataDisplays().iterator().next();
            final DynamicSelectionCell dynamicSelectionCell = (DynamicSelectionCell) cellTable.getColumn( 0 ).getCell();
            List<String> newOptions = null;
            if ( "double".equalsIgnoreCase( field ) || "int".equalsIgnoreCase( field ) || endsWithIgnoreCase(field, "integer")) {
                newOptions = Arrays.asList( numericOperators );
            } else if ( "boolean".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( booleanOperators );
                CustomEditTextCell etc = (CustomEditTextCell) cellTable.getColumn( 1 ).getCell();
                etc.setEnabled( false );
                ( (Button) selectedTable.getWidget( 0, 3 ) ).setEnabled( characteristicsAttrMap.get( selectedTable ).getList().size() != 2 );
                if ( newAttribute != null ) {
                    newAttribute.setValue( GuidedScoreCardConstants.INSTANCE.notApplicable() );
                }
            } else if ( "String".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( stringOperators );
            }
            dynamicSelectionCell.setOptions( newOptions );
            if ( newAttribute != null ) {
                if ( newOptions != null ) {
                    newAttribute.setOperator( newOptions.get( 0 ) );
                }
            }
        }
    }
View Full Code Here


            //first attribute, construct and add the table
            VerticalPanel vPanel = characteristicsAttrPanelMap.get( selectedTable );
            vPanel.add( addAttributeCellTable( selectedTable, characteristic, enumColumn, dataType, operators ) );
            characteristicsAttrPanelMap.remove( selectedTable );
        }
        Attribute newAttribute = null;
        if ( attribute != null ) {
            characteristicsAttrMap.get( selectedTable ).getList().add( attribute );
        } else {
            newAttribute = new Attribute();
            characteristicsAttrMap.get( selectedTable ).getList().add( newAttribute );
            newAttribute.setOperator( operators.get( 0 ) );
        }
        characteristicsAttrMap.get( selectedTable ).refresh();
        if ( "boolean".equalsIgnoreCase( dataType ) ) {
            ( (Button) selectedTable.getWidget( 0, 3 ) ).setEnabled( characteristicsAttrMap.get( selectedTable ).getList().size() != 2 );
            if ( newAttribute != null ) {
                newAttribute.setValue( GuidedScoreCardConstants.INSTANCE.notApplicable() );
            }
        }
    }
View Full Code Here

        }
    }

    private void addAttribute( final DirtyableFlexTable selectedTable,
                               final Attribute attribute ) {
        Attribute newAttribute = null;
        if ( attribute != null ) {
            characteristicsAttrMap.get( selectedTable ).getList().add( attribute );
        } else {
            newAttribute = new Attribute();
            characteristicsAttrMap.get( selectedTable ).getList().add( newAttribute );
        }
        characteristicsAttrMap.get( selectedTable ).refresh();

        //Disable the fact & field dropdowns
        ( (ListBox) selectedTable.getWidget( 2,
                                             0 ) ).setEnabled( false );
        ( (ListBox) selectedTable.getWidget( 2,
                                             1 ) ).setEnabled( false );
        final ListBox edd = ( (ListBox) selectedTable.getWidget( 2,
                                                                 1 ) );
        if ( edd.getSelectedIndex() > -1 ) {
            String field = edd.getValue( edd.getSelectedIndex() );
            field = field.substring( field.indexOf( ":" ) + 1 ).trim();
            final CellTable<Attribute> cellTable = (CellTable<Attribute>) characteristicsAttrMap.get( selectedTable ).getDataDisplays().iterator().next();
            final DynamicSelectionCell dynamicSelectionCell = (DynamicSelectionCell) cellTable.getColumn( 0 ).getCell();
            List<String> newOptions = null;
            if ( "double".equalsIgnoreCase( field ) || "int".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( numericOperators );
            } else if ( "boolean".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( booleanOperators );
                CustomEditTextCell etc = (CustomEditTextCell) cellTable.getColumn( 1 ).getCell();
                etc.setEnabled( false );
                ( (Button) selectedTable.getWidget( 0, 3 ) ).setEnabled( characteristicsAttrMap.get( selectedTable ).getList().size() != 2 );
                if ( newAttribute != null ) {
                    newAttribute.setValue( GuidedScoreCardConstants.INSTANCE.notApplicable() );
                }
            } else if ( "String".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( stringOperators );
            }
            dynamicSelectionCell.setOptions( newOptions );
            if ( newAttribute != null ) {
                if ( newOptions != null ) {
                    newAttribute.setOperator( newOptions.get( 0 ) );
                }
            }
        }
    }
View Full Code Here

        c.setDataType( "int" );
        c.setField( "attribute" );
        c.setBaselineScore( 0.0 );
        c.setReasonCode( "" );

        final Attribute a = new Attribute();
        a.setOperator( "=" );
        a.setValue( "10" );
        a.setPartialScore( 0.1 );
        a.setReasonCode( "" );

        c.getAttributes().add( a );
        model.getCharacteristics().add( c );

        return model;
View Full Code Here

        c.setDataType( "Double" );
        c.setField( "age" );
        c.setBaselineScore( 0.0 );
        c.setReasonCode( "" );

        final Attribute a = new Attribute();
        a.setOperator( "=" );
        a.setValue( "10" );
        a.setPartialScore( 0.1 );
        a.setReasonCode( "" );

        c.getAttributes().add( a );
        model.getCharacteristics().add( c );

        final String drl1 = GuidedScoreCardDRLPersistence.marshal( model );
View Full Code Here

        }
    }

    private void addAttribute( final DirtyableFlexTable selectedTable,
                               final Attribute attribute ) {
        Attribute newAttribute = null;
        if ( attribute != null ) {
            characteristicsAttrMap.get( selectedTable ).getList().add( attribute );
        } else {
            newAttribute = new Attribute();
            characteristicsAttrMap.get( selectedTable ).getList().add( newAttribute );
        }
        characteristicsAttrMap.get( selectedTable ).refresh();

        //Disable the fact & field dropdowns
        ( (ListBox) selectedTable.getWidget( 2,
                                             0 ) ).setEnabled( false );
        ( (ListBox) selectedTable.getWidget( 2,
                                             1 ) ).setEnabled( false );
        final ListBox edd = ( (ListBox) selectedTable.getWidget( 2,
                                                                 1 ) );
        if ( edd.getSelectedIndex() > -1 ) {
            String field = edd.getValue( edd.getSelectedIndex() );
            field = field.substring( field.indexOf( ":" ) + 1 ).trim();
            final CellTable<Attribute> cellTable = (CellTable<Attribute>) characteristicsAttrMap.get( selectedTable ).getDataDisplays().iterator().next();
            final DynamicSelectionCell dynamicSelectionCell = (DynamicSelectionCell) cellTable.getColumn( 0 ).getCell();
            List<String> newOptions = null;
            if ( "double".equalsIgnoreCase( field ) || "int".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( numericOperators );
            } else if ( "boolean".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( booleanOperators );
                CustomEditTextCell etc = (CustomEditTextCell) cellTable.getColumn( 1 ).getCell();
                etc.setEnabled( false );
                ( (Button) selectedTable.getWidget( 0, 3 ) ).setEnabled( characteristicsAttrMap.get( selectedTable ).getList().size() != 2 );
                if ( newAttribute != null ) {
                    newAttribute.setValue( GuidedScoreCardConstants.INSTANCE.notApplicable() );
                }
            } else if ( "String".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( stringOperators );
            }
            dynamicSelectionCell.setOptions( newOptions );
            if ( newAttribute != null ) {
                if ( newOptions != null ) {
                    newAttribute.setOperator( newOptions.get( 0 ) );
                }
            }
        }
    }
View Full Code Here

        }
    }

    private void addAttribute( final DirtyableFlexTable selectedTable,
                               final Attribute attribute ) {
        Attribute newAttribute = null;
        if ( attribute != null ) {
            characteristicsAttrMap.get( selectedTable ).getList().add( attribute );
        } else {
            newAttribute = new Attribute();
            characteristicsAttrMap.get( selectedTable ).getList().add( newAttribute );
        }
        characteristicsAttrMap.get( selectedTable ).refresh();

        //Disable the fact & field dropdowns
        ( (ListBox) selectedTable.getWidget( 2,
                                             0 ) ).setEnabled( false );
        ( (ListBox) selectedTable.getWidget( 2,
                                             1 ) ).setEnabled( false );
        final ListBox edd = ( (ListBox) selectedTable.getWidget( 2,
                                                                 1 ) );
        if ( edd.getSelectedIndex() > -1 ) {
            String field = edd.getValue( edd.getSelectedIndex() );
            field = field.substring( field.indexOf( ":" ) + 1 ).trim();
            final CellTable<Attribute> cellTable = (CellTable<Attribute>) characteristicsAttrMap.get( selectedTable ).getDataDisplays().iterator().next();
            final DynamicSelectionCell dynamicSelectionCell = (DynamicSelectionCell) cellTable.getColumn( 0 ).getCell();
            List<String> newOptions = null;
            if ( "double".equalsIgnoreCase( field ) || "int".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( numericOperators );
            } else if ( "boolean".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( booleanOperators );
                CustomEditTextCell etc = (CustomEditTextCell) cellTable.getColumn( 1 ).getCell();
                etc.setEnabled( false );
                ( (Button) selectedTable.getWidget( 0, 3 ) ).setEnabled( characteristicsAttrMap.get( selectedTable ).getList().size() != 2 );
                if ( newAttribute != null ) {
                    newAttribute.setValue( GuidedScoreCardConstants.INSTANCE.notApplicable() );
                }
            } else if ( "String".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( stringOperators );
            }
            dynamicSelectionCell.setOptions( newOptions );
            if ( newAttribute != null ) {
                if ( newOptions != null ) {
                    newAttribute.setOperator( newOptions.get( 0 ) );
                }
            }
        }
    }
View Full Code Here

        }
    }

    private void addAttribute( final DirtyableFlexTable selectedTable,
                               final Attribute attribute ) {
        Attribute newAttribute = null;
        if ( attribute != null ) {
            characteristicsAttrMap.get( selectedTable ).getList().add( attribute );
        } else {
            newAttribute = new Attribute();
            characteristicsAttrMap.get( selectedTable ).getList().add( newAttribute );
        }
        characteristicsAttrMap.get( selectedTable ).refresh();

        //Disable the fact & field dropdowns
        ( (ListBox) selectedTable.getWidget( 2,
                                             0 ) ).setEnabled( false );
        ( (ListBox) selectedTable.getWidget( 2,
                                             1 ) ).setEnabled( false );
        final ListBox edd = ( (ListBox) selectedTable.getWidget( 2,
                                                                 1 ) );
        if ( edd.getSelectedIndex() > -1 ) {
            String field = edd.getValue( edd.getSelectedIndex() );
            field = field.substring( field.indexOf( ":" ) + 1 ).trim();
            final CellTable<Attribute> cellTable = (CellTable<Attribute>) characteristicsAttrMap.get( selectedTable ).getDataDisplays().iterator().next();
            final DynamicSelectionCell dynamicSelectionCell = (DynamicSelectionCell) cellTable.getColumn( 0 ).getCell();
            List<String> newOptions = null;
            if ( "double".equalsIgnoreCase( field ) || "int".equalsIgnoreCase( field ) || endsWithIgnoreCase(field, "integer")) {
                newOptions = Arrays.asList( numericOperators );
            } else if ( "boolean".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( booleanOperators );
                CustomEditTextCell etc = (CustomEditTextCell) cellTable.getColumn( 1 ).getCell();
                etc.setEnabled( false );
                ( (Button) selectedTable.getWidget( 0, 3 ) ).setEnabled( characteristicsAttrMap.get( selectedTable ).getList().size() != 2 );
                if ( newAttribute != null ) {
                    newAttribute.setValue( GuidedScoreCardConstants.INSTANCE.notApplicable() );
                }
            } else if ( "String".equalsIgnoreCase( field ) ) {
                newOptions = Arrays.asList( stringOperators );
            }
            if ( newOptions != null ) {
                dynamicSelectionCell.setOptions( newOptions );
            }
            if ( newAttribute != null ) {
                if ( newOptions != null ) {
                    newAttribute.setOperator( newOptions.get( 0 ) );
                }
            }
        }
    }
View Full Code Here

        c.setDataType( "Double" );
        c.setField( "age" );
        c.setBaselineScore( 0.0 );
        c.setReasonCode( "" );

        final Attribute a = new Attribute();
        a.setOperator( "=" );
        a.setValue( "10" );
        a.setPartialScore( 0.1 );
        a.setReasonCode( "" );

        c.getAttributes().add( a );
        model.getCharacteristics().add( c );

        final String drl1 = GuidedScoreCardDRLPersistence.marshal( model );
View Full Code Here

        c.setDataType( "int" );
        c.setField( "attribute" );
        c.setBaselineScore( 0.0 );
        c.setReasonCode( "" );

        final Attribute a = new Attribute();
        a.setOperator( "=" );
        a.setValue( "10" );
        a.setPartialScore( 0.1 );
        a.setReasonCode( "" );

        c.getAttributes().add( a );
        model.getCharacteristics().add( c );

        return model;
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.scorecard.shared.Attribute

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.