}
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( Long.valueOf( event.getValue() ) );
} catch ( NumberFormatException nfe ) {
if ( allowEmptyValues ) {
value.setNumericValue( (Long) null );
tb.setValue( "" );
} else {
value.setNumericValue( 0L );
tb.setValue( "0" );
}
}
}
} );