41 |
aurelien |
1 |
package org.tela_botanica.del.client.vues.plateformedetermination.forum;
|
|
|
2 |
|
|
|
3 |
import java.util.List;
|
|
|
4 |
|
94 |
aurelien |
5 |
import org.tela_botanica.del.client.modeles.ObservationValidation;
|
|
|
6 |
import org.tela_botanica.del.client.utils.GwtObservable;
|
|
|
7 |
import org.tela_botanica.del.client.utils.GwtObserver;
|
84 |
benjamin |
8 |
import org.tela_botanica.del.client.cache.CacheClient;
|
41 |
aurelien |
9 |
import org.tela_botanica.del.client.utils.MockDatasource;
|
|
|
10 |
|
|
|
11 |
import com.google.gwt.core.client.GWT;
|
|
|
12 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
13 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
14 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
15 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
16 |
import com.google.gwt.user.client.ui.HasWidgets;
|
|
|
17 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
18 |
|
94 |
aurelien |
19 |
public class ForumPresenteur implements GwtObserver {
|
84 |
benjamin |
20 |
|
46 |
aurelien |
21 |
private ForumVue forumVue = new ForumVue();
|
41 |
aurelien |
22 |
|
84 |
benjamin |
23 |
private final MockDatasource validationService = MockDatasource.getInstance();
|
94 |
aurelien |
24 |
private List<ObservationValidation> determinations;
|
84 |
benjamin |
25 |
|
41 |
aurelien |
26 |
public void go(HasWidgets composite) {
|
84 |
benjamin |
27 |
|
94 |
aurelien |
28 |
validationService.addObserver(this);
|
|
|
29 |
|
46 |
aurelien |
30 |
chargerCommentaires();
|
|
|
31 |
composite.add(forumVue);
|
41 |
aurelien |
32 |
}
|
84 |
benjamin |
33 |
|
46 |
aurelien |
34 |
private void chargerCommentaires() {
|
94 |
aurelien |
35 |
|
|
|
36 |
determinations = validationService.getValidationData(CacheClient.getInstance().getCurrentObservation().getIdImage());
|
46 |
aurelien |
37 |
forumVue.chargerObservations(determinations);
|
41 |
aurelien |
38 |
}
|
94 |
aurelien |
39 |
|
|
|
40 |
@Override
|
|
|
41 |
public void update(GwtObservable observable, Object data) {
|
|
|
42 |
chargerCommentaires();
|
|
|
43 |
}
|
41 |
aurelien |
44 |
}
|