private String convertFloatValueToString( DTCellValue52 dcv ) { final Float value = (Float) dcv.getNumericValue(); return ( value == null ? "" : value.toString() ); }
private String convertShortValueToString( DTCellValue52 dcv ) { final Short value = (Short) dcv.getNumericValue(); return ( value == null ? "" : value.toString() ); }
private String convertBigDecimalValueToString( DTCellValue52 dcv ) { final BigDecimal value = (BigDecimal) dcv.getNumericValue(); return ( value == null ? "" : value.toPlainString() ); }
private String convertIntegerValueToString( DTCellValue52 dcv ) { final Integer value = (Integer) dcv.getNumericValue(); return ( value == null ? "" : value.toString() ); }
private String convertLongValueToString( DTCellValue52 dcv ) { final Long value = (Long) dcv.getNumericValue(); return ( value == null ? "" : value.toString() ); }
private String convertBigIntegerValueToString( DTCellValue52 dcv ) { final BigInteger value = (BigInteger) dcv.getNumericValue(); return ( value == null ? "" : value.toString() ); }
private String convertNumericValueToString( DTCellValue52 dcv ) { final BigDecimal value = (BigDecimal) dcv.getNumericValue(); return ( value == null ? "" : value.toPlainString() ); }
private String convertByteValueToString( DTCellValue52 dcv ) { final Byte value = (Byte) dcv.getNumericValue(); return ( value == null ? "" : value.toString() ); }
private String convertDoubleValueToString( DTCellValue52 dcv ) { final Double value = (Double) dcv.getNumericValue(); return ( value == null ? "" : value.toString() ); }
private AbstractRestrictedEntryTextBox makeNumericBigIntegerTextBox( final DTCellValue52 value ) { final AbstractRestrictedEntryTextBox tb = new NumericBigIntegerTextBox( allowEmptyValues ); final BigInteger numericValue = (BigInteger) 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 BigInteger( event.getValue() ) ); } catch ( NumberFormatException nfe ) { if ( allowEmptyValues ) { value.setNumericValue( (BigInteger) null ); tb.setValue( "" ); } else { value.setNumericValue( BigInteger.ZERO ); tb.setValue( BigInteger.ZERO.toString() ); } } } } ); } 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" ); } } } } ); } return tb; }
private AbstractRestrictedEntryTextBox makeNumericFloatTextBox( final DTCellValue52 value ) { final AbstractRestrictedEntryTextBox tb = new NumericFloatTextBox( allowEmptyValues ); final Float numericValue = (Float) 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 Float( event.getValue() ) ); } catch ( NumberFormatException nfe ) { if ( allowEmptyValues ) { value.setNumericValue( (Float) null ); tb.setValue( "" ); } else { value.setNumericValue( new Float( "0" ) ); tb.setValue( "0" ); } } } } ); } return tb; }
private AbstractRestrictedEntryTextBox makeNumericTextBox( final DTCellValue52 value ) { final AbstractRestrictedEntryTextBox tb = new NumericTextBox( allowEmptyValues ); final BigDecimal numericValue = (BigDecimal) value.getNumericValue(); tb.setValue( numericValue == null ? "" : numericValue.toPlainString() ); // Wire up update handler tb.setEnabled( !isReadOnly ); if ( !isReadOnly ) { tb.addValueChangeHandler( new ValueChangeHandler<String>() { public void onValueChange( ValueChangeEvent<String> event ) { try { value.setNumericValue( new BigDecimal( event.getValue() ) ); } catch ( NumberFormatException nfe ) { if ( allowEmptyValues ) { value.setNumericValue( (BigDecimal) null ); tb.setValue( "" ); } else { value.setNumericValue( BigDecimal.ZERO ); tb.setValue( BigDecimal.ZERO.toPlainString() ); } } } } ); } return tb; }
private AbstractRestrictedEntryTextBox makeNumericByteTextBox( final DTCellValue52 value ) { final AbstractRestrictedEntryTextBox tb = new NumericByteTextBox( allowEmptyValues ); final Byte numericValue = (Byte) 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 Byte( event.getValue() ) ); } catch ( NumberFormatException nfe ) { if ( allowEmptyValues ) { value.setNumericValue( (Byte) null ); tb.setValue( "" ); } else { value.setNumericValue( new Byte( "0" ) ); tb.setValue( "0" ); } } } } ); } 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" ); } } } } ); } return tb; }
private AbstractRestrictedEntryTextBox makeNumericBigDecimalTextBox( final DTCellValue52 value ) { final AbstractRestrictedEntryTextBox tb = new NumericBigDecimalTextBox( allowEmptyValues ); final BigDecimal numericValue = (BigDecimal) value.getNumericValue(); tb.setValue( numericValue == null ? "" : numericValue.toPlainString() ); // Wire up update handler tb.setEnabled( !isReadOnly ); if ( !isReadOnly ) { tb.addValueChangeHandler( new ValueChangeHandler<String>() { public void onValueChange( ValueChangeEvent<String> event ) { try { value.setNumericValue( new BigDecimal( event.getValue() ) ); } catch ( NumberFormatException nfe ) { if ( allowEmptyValues ) { value.setNumericValue( (BigDecimal) null ); tb.setValue( "" ); } else { value.setNumericValue( BigDecimal.ZERO ); tb.setValue( BigDecimal.ZERO.toPlainString() ); } } } } ); } return tb; }
private AbstractRestrictedEntryTextBox makeNumericDoubleTextBox( final DTCellValue52 value ) { final AbstractRestrictedEntryTextBox tb = new NumericDoubleTextBox( allowEmptyValues ); final Double numericValue = (Double) 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 Double( event.getValue() ) ); } catch ( NumberFormatException nfe ) { if ( allowEmptyValues ) { value.setNumericValue( (Double) null ); tb.setValue( "" ); } else { value.setNumericValue( new Double( "0" ) ); tb.setValue( "0" ); } } } } ); } return tb; }
private AbstractRestrictedEntryTextBox makeNumericIntegerTextBox( final DTCellValue52 value ) { final AbstractRestrictedEntryTextBox tb = new NumericIntegerTextBox( allowEmptyValues ); final Integer numericValue = (Integer) 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 Integer( event.getValue() ) ); } catch ( NumberFormatException nfe ) { if ( allowEmptyValues ) { value.setNumericValue( (Integer) null ); tb.setValue( "" ); } else { value.setNumericValue( new Integer( "0" ) ); tb.setValue( "0" ); } } } } ); } return tb; }
private void convertDTCellValueFromNumeric( DataType.DataTypes dataType, DTCellValue52 dcv ) { final BigDecimal value = (BigDecimal) dcv.getNumericValue(); switch ( dataType ) { case NUMERIC_BIGDECIMAL:
private void isRowEquivalent( List<DTCellValue52> row, String[] array ) { assertEquals( row.size(), array.length ); int newRowNum = (Integer) row.get( 0 ).getNumericValue(); int oldRowNum = Integer.valueOf( array[ 0 ] ); assertEquals( newRowNum, oldRowNum ); for ( int iCol = 1; iCol < row.size(); iCol++ ) { DTCellValue52 cell = row.get( iCol ); String v1 = cell.getStringValue(); String v2 = array[ iCol ]; assertTrue( isEqualOrNull( v1, v2 ) ); assertEquals( v1, v2 ); } }