if (topic.doThreadListView()) {
for (ForumPost post : result.getPosts()) {
allPosts.add(new PostDisplay(post));
}
} else {
TableWithHeaders table = new TableWithHeaders(result
.getPosts().size(), "Thread", "Replies", "Date",
"Author");
int row = 0;
for (ForumPost post : result.getPosts()) {
addShortDisplay(table, row, post);
row++;
}
table.getColumnFormatter().setStyleName(0, "title");
table.getColumnFormatter().setStyleName(1, "replies");
table.getColumnFormatter().setStyleName(3, "author");
allPosts.add(table);
}
if (result.getPosts().size() == 0) {
allPosts.add(new Label("No Posts Yet"));