litesoft
Diff Revisions
475
vs
948
for /trunk/Java/GWT/Client/src/com/google/gwt/gen2/table/client/DefaultCellRenderer.java
|
@@ -26,8 +26,7 @@ |
26 |
26 |
|
* @param <RowType> the type of the row value |
27 |
27 |
|
* @param <ColType> the data type of the column |
28 |
28 |
|
*/ |
29 |
|
- |
public class DefaultCellRenderer<RowType, ColType> implements CellRenderer<RowType, ColType> |
30 |
|
- |
{ |
|
29 |
+ |
public class DefaultCellRenderer<RowType, ColType> implements CellRenderer<RowType, ColType> { |
31 |
30 |
|
|
32 |
31 |
|
/** |
33 |
32 |
|
* If true, text will be rendered as html. |
|
@@ -37,8 +36,7 @@ |
37 |
36 |
|
/** |
38 |
37 |
|
* Construct a new {@link DefaultCellRenderer}. |
39 |
38 |
|
*/ |
40 |
|
- |
public DefaultCellRenderer() |
41 |
|
- |
{ |
|
39 |
+ |
public DefaultCellRenderer() { |
42 |
40 |
|
} |
43 |
41 |
|
|
44 |
42 |
|
/** |
|
@@ -46,28 +44,19 @@ |
46 |
44 |
|
* |
47 |
45 |
|
* @param asHtml if true, non-widget cell contents will be rendered as html |
48 |
46 |
|
*/ |
49 |
|
- |
public DefaultCellRenderer( boolean asHtml ) |
50 |
|
- |
{ |
|
47 |
+ |
public DefaultCellRenderer( boolean asHtml ) { |
51 |
48 |
|
this.asHtml = asHtml; |
52 |
49 |
|
} |
53 |
50 |
|
|
54 |
|
- |
public void renderRowValue( RowType rowValue, ColumnDefinition<RowType, ColType> columnDef, AbstractCellView<RowType> view ) |
55 |
|
- |
{ |
|
51 |
+ |
public void renderRowValue( RowType rowValue, ColumnDefinition<RowType, ColType> columnDef, AbstractCellView<RowType> view ) { |
56 |
52 |
|
Object cellValue = columnDef.getCellValue( rowValue ); |
57 |
|
- |
if ( cellValue == null ) |
58 |
|
- |
{ |
|
53 |
+ |
if ( cellValue == null ) { |
59 |
54 |
|
view.setText( "" ); |
60 |
|
- |
} |
61 |
|
- |
else if ( cellValue instanceof Widget ) |
62 |
|
- |
{ |
|
55 |
+ |
} else if ( cellValue instanceof Widget ) { |
63 |
56 |
|
view.setWidget( (Widget) cellValue ); |
64 |
|
- |
} |
65 |
|
- |
else if ( asHtml ) |
66 |
|
- |
{ |
|
57 |
+ |
} else if ( asHtml ) { |
67 |
58 |
|
view.setHTML( cellValue.toString() ); |
68 |
|
- |
} |
69 |
|
- |
else |
70 |
|
- |
{ |
|
59 |
+ |
} else { |
71 |
60 |
|
view.setText( cellValue.toString() ); |
72 |
61 |
|
} |
73 |
62 |
|
} |