grid.getCellFormatter().setHorizontalAlignment(0, 1, HasAlignment.ALIGN_CENTER);
grid.getRowFormatter().setStyleName(0, "clinic-tables-header");
int row = 1;
Iterator<Vet> vetsIt = collection.iterator();
while (vetsIt.hasNext()) {
final Vet vet = vetsIt.next();
final Label details = new Label(vet.getFirstName() + " " + vet.getLastName());
details.addClickListener(new ClickListener() {
public void onClick(Widget widget) {
final DialogBox detailsPanel = new DialogBox(true);
String html = "Id: " + vet.getId()
+ "<br/>First Name: " + vet.getFirstName()
+ "<br/>Last Name: " + vet.getLastName()
+ "<br/>Phone: " + vet.getTelephone()
+ "<br/>Specialties: " ;
Iterator specialtiesIt = vet.getSpecialties().iterator();
while (specialtiesIt.hasNext()) {
Specialty specialty = (Specialty) specialtiesIt.next();
html = html + specialty.getName();
if (specialtiesIt.hasNext()) {
html += ",";
}
}
HTML htmlValue = new HTML(html);
htmlValue.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
detailsPanel.setWidget(htmlValue);
detailsPanel.setTitle(vet.getFirstName() + " " + vet.getLastName());
detailsPanel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
public void setPosition(int offsetWidth, int offsetHeight) {
detailsPanel.setPopupPosition(details.getAbsoluteLeft(), details.getAbsoluteTop());
}
});