我有从表中执行数据的方法。如何将这些记录传递到Google Web工具包的datagrid?
public void getAllGitRecords(){
try {
db = new ODatabaseDocumentTx(dbAdres);
db.open("admin", "admin");
try {
for (ODocument gitCommitsTable : db.browseClass("GitStorage")) {
//May be I should put the data in some container here?
//So what kind of container it could be?
System.out.print(gitCommitsTable.getRecord().getIdentity() + " | ");
System.out.print(gitCommitsTable.field("sha") + " | ");
System.out.print(gitCommitsTable.field("comment") + " | ");
System.out.print(gitCommitsTable.field("date") + " | ");
System.out.print(gitCommitsTable.field("h") + " | ");
System.out.print(gitCommitsTable.field("m") + " | ");
System.out.println(gitCommitsTable.field("l") + " | ");
}
} catch (IllegalArgumentException ex) {
System.out.println("The table GitStorage is empty");
}
} finally {
db.close();
}
}
最佳答案
我建议您阅读有关GWT中的单元小部件的教程:
http://www.gwtproject.org/doc/latest/DevGuideUiCellWidgets.html