litesoft
Diff Revisions
23
vs
49
for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/datatables/MockTable.java
|
@@ -1,3 +1,4 @@ |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt |
1 |
2 |
|
package org.litesoft.GWT.client.widgets.datatables; |
2 |
3 |
|
|
3 |
4 |
|
import java.util.*; |
|
@@ -28,7 +29,7 @@ |
28 |
29 |
|
TableElement mockGrid = TableElement.as( pTable.getDataTable().getElement().cloneNode( true ).<Element>cast() ); |
29 |
30 |
|
TableSectionElement gridBody = mockGrid.getTBodies().getItem( 0 ); |
30 |
31 |
|
TableRowElement gridRow = Document.get().createTRElement(); // item 0 is the "ghost row" |
31 |
|
- |
|
|
32 |
+ |
|
32 |
33 |
|
RowType rowValue = pTableDefinition.getPrototypeRowValue(); |
33 |
34 |
|
if (rowValue != null) |
34 |
35 |
|
{ |
|
@@ -61,7 +62,7 @@ |
61 |
62 |
|
CommonElementHelper.hide( outer ); |
62 |
63 |
|
return new CreateResult(outer, gridRow); |
63 |
64 |
|
} |
64 |
|
- |
|
|
65 |
+ |
|
65 |
66 |
|
/** |
66 |
67 |
|
* Render full row w/ prototype values |
67 |
68 |
|
*/ |
|
@@ -72,7 +73,7 @@ |
72 |
73 |
|
{ |
73 |
74 |
|
pTr.removeChild(child); |
74 |
75 |
|
} |
75 |
|
- |
|
|
76 |
+ |
|
76 |
77 |
|
List<ColumnDefinition<RowType, ?>> colDefs = pTableDefinition.getVisibleColumnDefinitions(); |
77 |
78 |
|
PrototypeTableCellView<RowType> view = new PrototypeTableCellView<RowType>(); |
78 |
79 |
|
for (ColumnDefinition<RowType, ?> colDef : colDefs) |
|
@@ -84,16 +85,16 @@ |
84 |
85 |
|
pTr.appendChild( td ); |
85 |
86 |
|
} |
86 |
87 |
|
} |
87 |
|
- |
|
|
88 |
+ |
|
88 |
89 |
|
private static class PrototypeTableCellView<RowType> extends AbstractCellView<RowType> |
89 |
90 |
|
{ |
90 |
91 |
|
private TableCellElement mTd; |
91 |
|
- |
|
|
92 |
+ |
|
92 |
93 |
|
public PrototypeTableCellView() |
93 |
94 |
|
{ |
94 |
95 |
|
super(null); |
95 |
96 |
|
} |
96 |
|
- |
|
|
97 |
+ |
|
97 |
98 |
|
public void setTd(TableCellElement pTd) |
98 |
99 |
|
{ |
99 |
100 |
|
mTd = pTd; |
|
@@ -141,12 +142,12 @@ |
141 |
142 |
|
mTd.appendChild(pWidget.getElement()); |
142 |
143 |
|
} |
143 |
144 |
|
} |
144 |
|
- |
|
|
145 |
+ |
|
145 |
146 |
|
public static class CreateResult |
146 |
147 |
|
{ |
147 |
148 |
|
public final Element mTable; |
148 |
149 |
|
public final TableRowElement mPrototypeRow; |
149 |
|
- |
|
|
150 |
+ |
|
150 |
151 |
|
public CreateResult(Element pTable, TableRowElement pPrototypeRow) |
151 |
152 |
|
{ |
152 |
153 |
|
mTable = pTable; |