protected Object getRow(Client client) { Object row = ui.createTableRow(client); ui.add(row, ui.createTableCell(client.getFullName())); ui.add(row, ui.createTableCell(client.getPhoneNumber())); String neededitems = ""; for (TargetServiceItem tsi : reviewHandler.getSelectedServiceItems()) { if (neededitems.length() == 0) { neededitems = tsi.getServiceItem().getTargetName(); } else { neededitems = neededitems + ", " + tsi.getServiceItem().getTargetName(); } } ui.add(row, ui.createTableCell(neededitems)); return addCustomData(client, row); }
public void showFooter() { if (ui.getSelectedIndex(this.tableClients) >= 0) { Object selectedItem = ui.getSelectedItem(this.tableClients); Client attachedClient = ui.getAttachedObject(selectedItem, Client.class); ui.setText(ui.find(LBL_CLIENT_NAME), NAME + attachedClient.getFullName()); ui.setText(ui.find(LBL_TO_SAVE), TO_SAVE + reviewHandler.getTotalAmount()); ui.setText(ui.find(LBL_START_DATE), STARTING_ON + sdf.format(reviewHandler.getStartDate())); ui.setText(ui.find(LBL_END_DATE), ENDING_ON + sdf.format(reviewHandler.getEndDate())); } else { Client fstClient = reviewHandler.getSelectedClients().get(0); ui.setText(ui.find(LBL_CLIENT_NAME), NAME + fstClient.getFirstName()); ui.setText(ui.find(LBL_TO_SAVE), TO_SAVE + reviewHandler.getTotalAmount()); ui.setText(ui.find(LBL_START_DATE), STARTING_ON + sdf.format(reviewHandler.getStartDate())); ui.setText(ui.find(LBL_END_DATE), ENDING_ON + sdf.format(reviewHandler.getEndDate())); } }