1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| public class ListLotsPanel {
private FlexTable panelSponsor = new FlexTable();
private GestionSponsors appli;
public ListLotsPanel(GestionSponsors appli) {
this.appli = appli;
panelSponsor.setWidget(0, 0, new Label("Liste des lots"));
Image img=new Image();
SponsorLot sp=new SponsorLot("nom", img, "adresse","lot");
Lot l=new Lot("essai", 2);
sp.lierLot(l);
appli.lierSponsor(sp);
listLots();
}
private void listLots() {
int nbLignes = 1;
HashSet<Sponsor> listeSponsor = appli.getMesSponsors();
Iterator<Sponsor> it = listeSponsor.iterator();
while (it.hasNext()) {
if (it.next() instanceof SponsorLot) {
SponsorLot sponsor = (SponsorLot) it.next();
HashSet<Lot> listeLot = sponsor.getMesLots();
Iterator<Lot> it2 = listeLot.iterator();
while (it2.hasNext()) {
Label descr = new Label(it2.next().getDescription());
panelSponsor.setWidget(nbLignes, 0, descr);
nbLignes++;
}
}
}
}
public FlexTable getPanelSponsor() {
return panelSponsor;
}
} |
Partager