Package org.uberfire.client.common

Examples of org.uberfire.client.common.AbstractRestrictedEntryTextBox


        }
        return tb;
    }

    private AbstractRestrictedEntryTextBox makeNumericLongTextBox( final DTCellValue52 value ) {
        final AbstractRestrictedEntryTextBox tb = new NumericLongTextBox( allowEmptyValues );
        final Long numericValue = (Long) value.getNumericValue();
        tb.setValue( numericValue == null ? "" : numericValue.toString() );

        // Wire up update handler
        tb.setEnabled( !isReadOnly );
        if ( !isReadOnly ) {
            tb.addValueChangeHandler( new ValueChangeHandler<String>() {

                public void onValueChange( ValueChangeEvent<String> event ) {
                    try {
                        value.setNumericValue( new Long( event.getValue() ) );
                    } catch ( NumberFormatException nfe ) {
                        if ( allowEmptyValues ) {
                            value.setNumericValue( (Long) null );
                            tb.setValue( "" );
                        } else {
                            value.setNumericValue( new Long( "0" ) );
                            tb.setValue( "0" );
                        }
                    }
                }

            } );
View Full Code Here


        }
        return tb;
    }

    private AbstractRestrictedEntryTextBox makeNumericShortTextBox( final DTCellValue52 value ) {
        final AbstractRestrictedEntryTextBox tb = new NumericShortTextBox( allowEmptyValues );
        final Short numericValue = (Short) value.getNumericValue();
        tb.setValue( numericValue == null ? "" : numericValue.toString() );

        // Wire up update handler
        tb.setEnabled( !isReadOnly );
        if ( !isReadOnly ) {
            tb.addValueChangeHandler( new ValueChangeHandler<String>() {

                public void onValueChange( ValueChangeEvent<String> event ) {
                    try {
                        value.setNumericValue( new Short( event.getValue() ) );
                    } catch ( NumberFormatException nfe ) {
                        if ( allowEmptyValues ) {
                            value.setNumericValue( (Short) null );
                            tb.setValue( "" );
                        } else {
                            value.setNumericValue( new Short( "0" ) );
                            tb.setValue( "0" );
                        }
                    }
                }

            } );
View Full Code Here

    private void operatorChanged( OperatorSelection selection ) {
        parametersContainer.clear();
        String operator = selection.getValue();

        if ( CEPOracle.isCEPWindowOperatorTime( operator ) ) {
            AbstractRestrictedEntryTextBox txt = new CEPTimeParameterTextBox( hcw.getWindow(),
                                                                              1 );
            initialiseTextBox( txt );
        } else if ( CEPOracle.isCEPWindowOperatorLength( operator ) ) {
            AbstractRestrictedEntryTextBox txt = new CEPLengthParameterTextBox( hcw.getWindow(),
                                                                                1 );
            initialiseTextBox( txt );
        } else {
            parametersContainer.setVisible( false );
            hcw.getWindow().clearParameters();
View Full Code Here

        return container;
    }

    //TextBox factory
    private TextBox makeTextBox( final int index ) {
        AbstractRestrictedEntryTextBox txt = new CEPTimeParameterTextBox( hop,
                                                                          index );

        if ( parameterSets.size() == 0 ) {
            txt.setVisible( false );
        } else {
            txt.setVisible( index < parameterSets.get( visibleParameterSet ) );
        }

        return txt;
    }
View Full Code Here

TOP

Related Classes of org.uberfire.client.common.AbstractRestrictedEntryTextBox

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.