|
@@ -4,45 +4,46 @@ |
4 |
4 |
|
import java.util.*; |
5 |
5 |
|
|
6 |
6 |
|
import org.litesoft.GWT.client.event.*; |
7 |
|
- |
import org.litesoft.GWT.client.widgets.SizeableSimplePanel; |
|
7 |
+ |
import org.litesoft.GWT.client.widgets.*; |
8 |
8 |
|
import org.litesoft.core.util.*; |
9 |
9 |
|
|
10 |
10 |
|
import com.google.gwt.event.logical.shared.*; |
11 |
11 |
|
import com.google.gwt.event.shared.*; |
12 |
12 |
|
import com.google.gwt.gen2.table.client.*; |
13 |
|
- |
import com.google.gwt.user.client.Command; |
|
13 |
+ |
import com.google.gwt.user.client.*; |
14 |
14 |
|
import com.google.gwt.user.client.ui.*; |
15 |
15 |
|
|
16 |
16 |
|
/** |
17 |
17 |
|
* TODO: size |
18 |
18 |
|
* TODO: min height? |
19 |
19 |
|
*/ |
20 |
|
- |
public class RegularTable<T> extends SizeableSimplePanel implements HasSelectionHandlers<T>, TableDataReloadable |
|
20 |
+ |
public class RegularTable<T> extends SizeableSimplePanel implements HasSelectionHandlers<T>, |
|
21 |
+ |
TableDataReloadable |
21 |
22 |
|
{ |
22 |
23 |
|
protected final Table<T> mTable; |
23 |
24 |
|
|
24 |
25 |
|
/** |
25 |
|
- |
* @param pModel the data source |
|
26 |
+ |
* @param pModel the data source |
26 |
27 |
|
* @param pDefinition the column definition |
27 |
28 |
|
*/ |
28 |
|
- |
public RegularTable(ListTableModel<T> pModel, TableDefinitionPlus<T> pDefinition) |
|
29 |
+ |
public RegularTable( ListTableModel<T> pModel, TableDefinitionPlus<T> pDefinition ) |
29 |
30 |
|
{ |
30 |
|
- |
this(pModel, pDefinition, null); |
|
31 |
+ |
this( pModel, pDefinition, null ); |
31 |
32 |
|
} |
32 |
33 |
|
|
33 |
34 |
|
/** |
34 |
|
- |
* @param pModel the data source |
35 |
|
- |
* @param pDefinition the column definition |
|
35 |
+ |
* @param pModel the data source |
|
36 |
+ |
* @param pDefinition the column definition |
36 |
37 |
|
* @param pRowClickCommand {@link Command} to execute upon clicking a row, or <code>null</code> |
37 |
38 |
|
*/ |
38 |
|
- |
public RegularTable(ListTableModel<T> pModel, TableDefinitionPlus<T> pDefinition, TableClickCommand<T> pRowClickCommand) |
|
39 |
+ |
public RegularTable( ListTableModel<T> pModel, TableDefinitionPlus<T> pDefinition, TableClickCommand<T> pRowClickCommand ) |
39 |
40 |
|
{ |
40 |
|
- |
mTable = new Table<T>(pModel, pDefinition, pRowClickCommand); |
41 |
|
- |
mTable.setWidth("100%"); |
42 |
|
- |
mTable.setHeight("100%"); |
43 |
|
- |
setWidget(mTable); |
|
41 |
+ |
mTable = new Table<T>( pModel, pDefinition, pRowClickCommand ); |
|
42 |
+ |
mTable.setWidth( "100%" ); |
|
43 |
+ |
mTable.setHeight( "100%" ); |
|
44 |
+ |
setWidget( mTable ); |
44 |
45 |
|
stretchable(); |
45 |
|
- |
mTable.addSelectionHandler(new SelectionDelegator<T>(this)); |
|
46 |
+ |
mTable.addSelectionHandler( new SelectionDelegator<T>( this ) ); |
46 |
47 |
|
} |
47 |
48 |
|
|
48 |
49 |
|
protected TableModel<T> getModel() |
|
@@ -60,9 +61,9 @@ |
60 |
61 |
|
return mTable.getSelectionPolicy(); |
61 |
62 |
|
} |
62 |
63 |
|
|
63 |
|
- |
public void setSelectionPolicy(RowSelectionPolicy pSelectionPolicy) |
|
64 |
+ |
public void setSelectionPolicy( RowSelectionPolicy pSelectionPolicy ) |
64 |
65 |
|
{ |
65 |
|
- |
mTable.setSelectionPolicy(pSelectionPolicy); |
|
66 |
+ |
mTable.setSelectionPolicy( pSelectionPolicy ); |
66 |
67 |
|
} |
67 |
68 |
|
|
68 |
69 |
|
public void deselectAll() |
|
@@ -86,9 +87,9 @@ |
86 |
87 |
|
} |
87 |
88 |
|
|
88 |
89 |
|
@Override |
89 |
|
- |
public HandlerRegistration addSelectionHandler(SelectionHandler<T> pHandler) |
|
90 |
+ |
public HandlerRegistration addSelectionHandler( SelectionHandler<T> pHandler ) |
90 |
91 |
|
{ |
91 |
|
- |
return addHandler(pHandler, SelectionEvent.getType()); |
|
92 |
+ |
return addHandler( pHandler, SelectionEvent.getType() ); |
92 |
93 |
|
} |
93 |
94 |
|
|
94 |
95 |
|
public boolean isScrollVertically() |
|
@@ -96,9 +97,9 @@ |
96 |
97 |
|
return mTable.isScrollVertically(); |
97 |
98 |
|
} |
98 |
99 |
|
|
99 |
|
- |
public void setScrollVertically(boolean pScrollVertically) |
|
100 |
+ |
public void setScrollVertically( boolean pScrollVertically ) |
100 |
101 |
|
{ |
101 |
|
- |
mTable.setScrollVertically(pScrollVertically); |
|
102 |
+ |
mTable.setScrollVertically( pScrollVertically ); |
102 |
103 |
|
} |
103 |
104 |
|
|
104 |
105 |
|
public TableRowCountCallback getRowCountCallback() |
|
@@ -106,9 +107,9 @@ |
106 |
107 |
|
return mTable.getRowCountCallback(); |
107 |
108 |
|
} |
108 |
109 |
|
|
109 |
|
- |
public void setRowCountCallback(TableRowCountCallback pRowCountCallback) |
|
110 |
+ |
public void setRowCountCallback( TableRowCountCallback pRowCountCallback ) |
110 |
111 |
|
{ |
111 |
|
- |
mTable.setRowCountCallback(pRowCountCallback); |
|
112 |
+ |
mTable.setRowCountCallback( pRowCountCallback ); |
112 |
113 |
|
} |
113 |
114 |
|
|
114 |
115 |
|
public boolean isHeaderVisible() |
|
@@ -116,9 +117,9 @@ |
116 |
117 |
|
return mTable.isHeaderVisible(); |
117 |
118 |
|
} |
118 |
119 |
|
|
119 |
|
- |
public void setHeaderVisible(boolean pVisible) |
|
120 |
+ |
public void setHeaderVisible( boolean pVisible ) |
120 |
121 |
|
{ |
121 |
|
- |
mTable.setHeaderVisible(pVisible); |
|
122 |
+ |
mTable.setHeaderVisible( pVisible ); |
122 |
123 |
|
} |
123 |
124 |
|
|
124 |
125 |
|
public Widget getEmptyTableWidget() |
|
@@ -126,9 +127,9 @@ |
126 |
127 |
|
return mTable.getEmptyTableWidget(); |
127 |
128 |
|
} |
128 |
129 |
|
|
129 |
|
- |
public void setEmptyTableWidget(Widget pEmptyTableWidget) |
|
130 |
+ |
public void setEmptyTableWidget( Widget pEmptyTableWidget ) |
130 |
131 |
|
{ |
131 |
|
- |
mTable.setEmptyTableWidget(pEmptyTableWidget); |
|
132 |
+ |
mTable.setEmptyTableWidget( pEmptyTableWidget ); |
132 |
133 |
|
} |
133 |
134 |
|
|
134 |
135 |
|
@Override |