litesoft
Diff Revisions
475
vs
948
for /trunk/Java/GWT/Client/src/com/google/gwt/gen2/table/client/DefaultRowRenderer.java
|
@@ -23,8 +23,7 @@ |
23 |
23 |
|
* |
24 |
24 |
|
* @param <RowType> the type of the row value |
25 |
25 |
|
*/ |
26 |
|
- |
public class DefaultRowRenderer<RowType> implements RowRenderer<RowType> |
27 |
|
- |
{ |
|
26 |
+ |
public class DefaultRowRenderer<RowType> implements RowRenderer<RowType> { |
28 |
27 |
|
/** |
29 |
28 |
|
* The alternating colors to apply to the rows. |
30 |
29 |
|
*/ |
|
@@ -33,8 +32,7 @@ |
33 |
32 |
|
/** |
34 |
33 |
|
* Construct a new {@link DefaultRowRenderer}. |
35 |
34 |
|
*/ |
36 |
|
- |
public DefaultRowRenderer() |
37 |
|
- |
{ |
|
35 |
+ |
public DefaultRowRenderer() { |
38 |
36 |
|
this( null ); |
39 |
37 |
|
} |
40 |
38 |
|
|
|
@@ -43,15 +41,12 @@ |
43 |
41 |
|
* |
44 |
42 |
|
* @param rowColors an array of alternating colors to apply to the rows |
45 |
43 |
|
*/ |
46 |
|
- |
public DefaultRowRenderer( String[] rowColors ) |
47 |
|
- |
{ |
|
44 |
+ |
public DefaultRowRenderer( String[] rowColors ) { |
48 |
45 |
|
this.rowColors = rowColors; |
49 |
46 |
|
} |
50 |
47 |
|
|
51 |
|
- |
public void renderRowValue( RowType rowValue, AbstractRowView<RowType> view ) |
52 |
|
- |
{ |
53 |
|
- |
if ( rowColors != null ) |
54 |
|
- |
{ |
|
48 |
+ |
public void renderRowValue( RowType rowValue, AbstractRowView<RowType> view ) { |
|
49 |
+ |
if ( rowColors != null ) { |
55 |
50 |
|
int index = view.getRowIndex() % rowColors.length; |
56 |
51 |
|
view.setStyleAttribute( "background", rowColors[index] ); |
57 |
52 |
|
} |