lib/clevic/swing/table_view.rb in clevic-0.13.0.b3 vs lib/clevic/swing/table_view.rb in clevic-0.13.0.b5
- old
+ new
@@ -284,10 +284,10 @@
@jtable.column_model.column( col ).preferred_width = column_width( col, sample )
end
# calculate the size of the column from the string value of the data
def column_width( col, data )
- @jtable.getFontMetrics( @jtable.font).stringWidth( data ) + 5
+ @jtable.getFontMetrics( @jtable.font ).stringWidth( data.to_s ) + 5
end
def trim_middle( value, max = 40 )
if value && value.length > max
"#{value[0..(max/2-2)]}...#{value[-(max/2-2)..-1]}"