|
@@ -1,44 +1,43 @@ |
1 |
1 |
|
package com.temp.client.foundation.widget.table.column; |
2 |
2 |
|
|
3 |
|
- |
import java.util.List; |
|
3 |
+ |
import com.google.gwt.user.cellview.client.*; |
|
4 |
+ |
import com.temp.client.foundation.handler.*; |
|
5 |
+ |
import com.temp.client.foundation.widget.table.*; |
|
6 |
+ |
import com.temp.client.foundation.widget.table.cell.*; |
|
7 |
+ |
import com.temp.shared.utils.*; |
4 |
8 |
|
|
5 |
|
- |
import com.temp.client.foundation.handler.DataClickHandler; |
6 |
|
- |
import com.temp.client.foundation.widget.table.DataRow; |
7 |
|
- |
import com.temp.client.foundation.widget.table.cell.ClickableTextListDataCell; |
8 |
|
- |
import com.temp.shared.utils.DisplayStringHandler; |
9 |
|
- |
|
10 |
|
- |
import com.google.gwt.user.cellview.client.Column; |
|
9 |
+ |
import java.util.*; |
11 |
10 |
|
|
12 |
11 |
|
/** |
13 |
12 |
|
* A column of clickable text lists. The cell data consists of Lists of objects of type E |
14 |
13 |
|
* and each element of the list is clickable |
15 |
14 |
|
* |
16 |
|
- |
* @author paule |
17 |
|
- |
* |
18 |
15 |
|
* @param <R> - the row type (e.g. Message) |
19 |
16 |
|
* @param <L> - the type of the list (e.g. ArrayList of MessageErrors) |
20 |
17 |
|
* @param <E> - the type of the list element (e.g. MessageError) |
|
18 |
+ |
* |
|
19 |
+ |
* @author paule |
21 |
20 |
|
*/ |
22 |
21 |
|
@SuppressWarnings("rawtypes") |
23 |
22 |
|
public class ClickableTextListDataColumn<R extends DataRow, L extends List<E>, E> extends Column<R, L> implements DataColumn { |
24 |
23 |
|
|
25 |
24 |
|
public static interface GetElementDisplayStringFn<E> { |
26 |
|
- |
String getDisplayString(E element); |
|
25 |
+ |
String getDisplayString( E element ); |
27 |
26 |
|
} |
28 |
27 |
|
|
29 |
28 |
|
Object field; |
30 |
29 |
|
|
31 |
|
- |
public ClickableTextListDataColumn(Object field, |
32 |
|
- |
DataClickHandler<E> clickHandler, |
33 |
|
- |
DisplayStringHandler<E> displayStringHandler) { |
34 |
|
- |
super(new ClickableTextListDataCell<E, L>(clickHandler, displayStringHandler)); |
|
30 |
+ |
public ClickableTextListDataColumn( Object field, |
|
31 |
+ |
DataClickHandler<E> clickHandler, |
|
32 |
+ |
DisplayStringHandler<E> displayStringHandler ) { |
|
33 |
+ |
super( new ClickableTextListDataCell<E, L>( clickHandler, displayStringHandler ) ); |
35 |
34 |
|
this.field = field; |
36 |
35 |
|
} |
37 |
36 |
|
|
38 |
37 |
|
@SuppressWarnings("unchecked") |
39 |
38 |
|
@Override |
40 |
|
- |
public L getValue(R rowData) { |
41 |
|
- |
return (L) rowData.getFieldValue(field); |
|
39 |
+ |
public L getValue( R rowData ) { |
|
40 |
+ |
return (L) rowData.getFieldValue( field ); |
42 |
41 |
|
} |
43 |
42 |
|
|
44 |
43 |
|
@Override |