|
@@ -1,107 +1,94 @@ |
1 |
1 |
|
package com.temp.client.foundation.widget.dialog; |
2 |
2 |
|
|
3 |
|
- |
import java.util.ArrayList; |
4 |
|
- |
import java.util.Comparator; |
5 |
|
- |
import java.util.List; |
6 |
|
- |
|
7 |
|
- |
import com.temp.client.foundation.widget.table.CachedDataTable; |
8 |
|
- |
import com.temp.client.foundation.widget.table.DataRow; |
9 |
|
- |
import com.temp.client.foundation.widget.table.DataRowField; |
10 |
|
- |
|
11 |
|
- |
import com.google.gwt.dom.client.Style.Unit; |
12 |
|
- |
import com.google.gwt.user.cellview.client.Column; |
13 |
|
- |
import com.google.gwt.user.client.ui.Widget; |
|
3 |
+ |
import com.google.gwt.dom.client.Style.*; |
|
4 |
+ |
import com.google.gwt.user.cellview.client.*; |
|
5 |
+ |
import com.google.gwt.user.client.ui.*; |
|
6 |
+ |
import com.temp.client.foundation.widget.table.*; |
|
7 |
+ |
|
|
8 |
+ |
import java.util.*; |
14 |
9 |
|
|
15 |
10 |
|
@SuppressWarnings("rawtypes") |
16 |
|
- |
public class DataTableDialogBox<R extends DataRow<F>,F> extends PopUpDialogBox { |
|
11 |
+ |
public class DataTableDialogBox<R extends DataRow<F>, F> extends PopUpDialogBox { |
17 |
12 |
|
private static final int DEFAULT_WIDTH_IN_PX = 700; |
18 |
|
- |
CachedDataTable<R,F> dataTable = new CachedDataTable<R,F>(); |
|
13 |
+ |
CachedDataTable<R, F> dataTable = new CachedDataTable<R, F>(); |
19 |
14 |
|
|
20 |
15 |
|
/** |
21 |
16 |
|
* Adds a column |
22 |
17 |
|
* |
23 |
|
- |
* @param fields |
24 |
|
- |
* - the column / "field" definitions |
|
18 |
+ |
* @param fields - the column / "field" definitions |
25 |
19 |
|
*/ |
26 |
|
- |
public <FIELD extends DataRowField> void addColumns(FIELD... fields) { |
27 |
|
- |
dataTable.addColumns(fields); |
|
20 |
+ |
public <FIELD extends DataRowField> void addColumns( FIELD... fields ) { |
|
21 |
+ |
dataTable.addColumns( fields ); |
28 |
22 |
|
} |
29 |
23 |
|
|
30 |
24 |
|
/** |
31 |
25 |
|
* Adds a column |
32 |
26 |
|
* |
33 |
|
- |
* @param field |
34 |
|
- |
* - the column or "field" definition |
|
27 |
+ |
* @param field - the column or "field" definition |
35 |
28 |
|
*/ |
36 |
|
- |
public <FIELD extends DataRowField> void addColumn(FIELD field) { |
37 |
|
- |
dataTable.addColumn(field); |
|
29 |
+ |
public <FIELD extends DataRowField> void addColumn( FIELD field ) { |
|
30 |
+ |
dataTable.addColumn( field ); |
38 |
31 |
|
} |
39 |
32 |
|
|
40 |
33 |
|
/** |
41 |
34 |
|
* Adds a column |
42 |
35 |
|
* |
43 |
|
- |
* @param column |
44 |
|
- |
* - the column |
45 |
|
- |
* @param field |
46 |
|
- |
* - the column definition "field" |
|
36 |
+ |
* @param column - the column |
|
37 |
+ |
* @param field - the column definition "field" |
47 |
38 |
|
*/ |
48 |
|
- |
public <FIELD extends DataRowField> void addColumn(Column<R, ?> column, FIELD field) { |
49 |
|
- |
dataTable.addColumn(column, field); |
|
39 |
+ |
public <FIELD extends DataRowField> void addColumn( Column<R, ?> column, FIELD field ) { |
|
40 |
+ |
dataTable.addColumn( column, field ); |
50 |
41 |
|
} |
51 |
42 |
|
|
52 |
43 |
|
/** |
53 |
44 |
|
* Adds a column |
54 |
45 |
|
* |
55 |
|
- |
* @param field |
56 |
|
- |
* - the column or "field" definition |
|
46 |
+ |
* @param field - the column or "field" definition |
57 |
47 |
|
* @param comparator - the comparator |
58 |
48 |
|
*/ |
59 |
|
- |
public <FIELD extends DataRowField> void addColumn(FIELD field, Comparator comparator) { |
60 |
|
- |
dataTable.addColumn(field, comparator); |
|
49 |
+ |
public <FIELD extends DataRowField> void addColumn( FIELD field, Comparator comparator ) { |
|
50 |
+ |
dataTable.addColumn( field, comparator ); |
61 |
51 |
|
} |
62 |
52 |
|
|
63 |
53 |
|
/** |
64 |
54 |
|
* Adds a column |
65 |
55 |
|
* |
66 |
|
- |
* @param column |
67 |
|
- |
* - the column |
68 |
|
- |
* @param field |
69 |
|
- |
* - the column definition "field" |
|
56 |
+ |
* @param column - the column |
|
57 |
+ |
* @param field - the column definition "field" |
70 |
58 |
|
* @param comparator - the comparator |
71 |
59 |
|
*/ |
72 |
|
- |
public <FIELD extends DataRowField> void addColumn(Column<R, ?> column, FIELD field, Comparator comparator) { |
73 |
|
- |
dataTable.addColumn(column, field, comparator); |
|
60 |
+ |
public <FIELD extends DataRowField> void addColumn( Column<R, ?> column, FIELD field, Comparator comparator ) { |
|
61 |
+ |
dataTable.addColumn( column, field, comparator ); |
74 |
62 |
|
} |
75 |
63 |
|
|
76 |
|
- |
public void addColumn(Column<R, ?> column, String columnHeader, String fieldName) { |
77 |
|
- |
dataTable.addColumn(column, columnHeader, fieldName); |
|
64 |
+ |
public void addColumn( Column<R, ?> column, String columnHeader, String fieldName ) { |
|
65 |
+ |
dataTable.addColumn( column, columnHeader, fieldName ); |
78 |
66 |
|
} |
79 |
67 |
|
|
80 |
|
- |
public void addColumn(Column<R, ?> column, String columnHeader, String fieldName, int width, Unit widthUnit) { |
81 |
|
- |
dataTable.addColumn(column, columnHeader, fieldName, width, widthUnit); |
|
68 |
+ |
public void addColumn( Column<R, ?> column, String columnHeader, String fieldName, int width, Unit widthUnit ) { |
|
69 |
+ |
dataTable.addColumn( column, columnHeader, fieldName, width, widthUnit ); |
82 |
70 |
|
} |
83 |
71 |
|
|
84 |
|
- |
public void addColumn(Column<R, ?> column, String columnHeader, String fieldName, Comparator comparator) { |
85 |
|
- |
dataTable.addColumn(column, columnHeader, fieldName, comparator); |
|
72 |
+ |
public void addColumn( Column<R, ?> column, String columnHeader, String fieldName, Comparator comparator ) { |
|
73 |
+ |
dataTable.addColumn( column, columnHeader, fieldName, comparator ); |
86 |
74 |
|
} |
87 |
75 |
|
|
88 |
|
- |
public void addColumn(Column<R, ?> column, String columnHeader, String fieldName, Comparator comparator, int width, Unit widthUnit) { |
89 |
|
- |
dataTable.addColumn(column, columnHeader, fieldName, comparator, width, widthUnit); |
|
76 |
+ |
public void addColumn( Column<R, ?> column, String columnHeader, String fieldName, Comparator comparator, int width, Unit widthUnit ) { |
|
77 |
+ |
dataTable.addColumn( column, columnHeader, fieldName, comparator, width, widthUnit ); |
90 |
78 |
|
} |
91 |
79 |
|
|
92 |
|
- |
public void show(String title, List<R> dataList) { |
93 |
|
- |
show(title, dataList, DEFAULT_WIDTH_IN_PX); |
|
80 |
+ |
public void show( String title, List<R> dataList ) { |
|
81 |
+ |
show( title, dataList, DEFAULT_WIDTH_IN_PX ); |
94 |
82 |
|
} |
95 |
83 |
|
|
96 |
|
- |
public void show(String title, List<R> dataList, Integer widthInPx) { |
97 |
|
- |
dataTable.setData(dataList); |
98 |
|
- |
|
|
84 |
+ |
public void show( String title, List<R> dataList, Integer widthInPx ) { |
|
85 |
+ |
dataTable.setData( dataList ); |
99 |
86 |
|
|
100 |
|
- |
if (widthInPx != null) { |
101 |
|
- |
dataTable.setWidth("" + widthInPx + "px"); |
|
87 |
+ |
if ( widthInPx != null ) { |
|
88 |
+ |
dataTable.setWidth( "" + widthInPx + "px" ); |
102 |
89 |
|
} |
103 |
90 |
|
List<Widget> contents = new ArrayList<Widget>(); |
104 |
|
- |
contents.add(dataTable); |
105 |
|
- |
setContentsAndShow(title, contents); |
|
91 |
+ |
contents.add( dataTable ); |
|
92 |
+ |
setContentsAndShow( title, contents ); |
106 |
93 |
|
} |
107 |
94 |
|
} |