Rev 140 | Blame | Last modification | View Log | RSS feed
package org.tela_botanica.del.client.vues.plateformedetermination.forum;
import java.util.List;
import org.tela_botanica.del.client.cache.CacheClient;
import org.tela_botanica.del.client.modeles.PropositionDetermination;
import org.tela_botanica.del.client.navigation.evenement.BusEvenementiel;
import org.tela_botanica.del.client.navigation.evenement.ajoutdetermination.EvenementAjoutDetermination;
import org.tela_botanica.del.client.navigation.evenement.ajoutdetermination.GestionnaireEvenementAjoutDetermination;
import com.google.gwt.user.client.ui.HasWidgets;
public class ForumPresenteur {
private ForumVue forumVue = new ForumVue();
private List<PropositionDetermination> determinations;
public void go(HasWidgets composite) {
chargerDeterminations();
composite.add(forumVue);
gererEvenements();
}
private void chargerDeterminations() {
determinations = CacheClient.getInstance().getCurrentObservation().getImageCelValidationDatas();
forumVue.chargerDeterminations(determinations);
}
private void gererEvenements() {
BusEvenementiel.getInstance().addHandler(EvenementAjoutDetermination.TYPE, new GestionnaireEvenementAjoutDetermination() {
@Override
public void onAjoutDetermination(EvenementAjoutDetermination event) {
forumVue.chargerDetermination(event.getPropositionDetermination());
}
});
}
}