Line 1... |
Line 1... |
1 |
package org.tela_botanica.del.client.vues.rechercheimages.moteur;
|
1 |
package org.tela_botanica.del.client.vues.rechercheimages.moteur;
|
Line 2... |
Line -... |
2 |
|
- |
|
3 |
import java.util.List;
|
- |
|
4 |
|
2 |
|
5 |
import org.tela_botanica.del.client.cache.CacheClient;
|
3 |
import org.tela_botanica.del.client.cache.CacheClient;
|
6 |
import org.tela_botanica.del.client.composants.moteurrecherche.MoteurRecherchePresenteur;
|
4 |
import org.tela_botanica.del.client.composants.moteurrecherche.MoteurRecherchePresenteur;
|
7 |
import org.tela_botanica.del.client.composants.moteurrecherche.MoteurRechercheVue;
|
5 |
import org.tela_botanica.del.client.composants.moteurrecherche.MoteurRechercheVue;
|
8 |
import org.tela_botanica.del.client.modeles.ModeRecherche;
|
6 |
import org.tela_botanica.del.client.modeles.ModeRecherche;
|
9 |
import org.tela_botanica.del.client.modeles.Protocole;
|
- |
|
10 |
import org.tela_botanica.del.client.navigation.evenement.BusEvenementiel;
|
- |
|
11 |
import org.tela_botanica.del.client.navigation.evenement.changementprotocole.EvenementChangementProtocole;
|
7 |
import org.tela_botanica.del.client.modeles.ProtocoleServiceResultat;
|
12 |
import org.tela_botanica.del.client.services.rest.ImageServiceConcret;
|
8 |
import org.tela_botanica.del.client.services.rest.ImageServiceConcret;
|
13 |
import org.tela_botanica.del.client.services.rest.ProtocoleService;
|
9 |
import org.tela_botanica.del.client.services.rest.ProtocoleService;
|
- |
|
10 |
import org.tela_botanica.del.client.services.rest.ProtocoleServiceConcret;
|
14 |
import org.tela_botanica.del.client.utils.MockDatasource;
|
11 |
import org.tela_botanica.del.client.services.rest.async.ProtocolesCallback;
|
15 |
import org.tela_botanica.del.client.vues.rechercheimages.resultats.ResultatRechercheImagePresenteur;
|
12 |
import org.tela_botanica.del.client.vues.rechercheimages.resultats.ResultatRechercheImagePresenteur;
|
16 |
import org.tela_botanica.del.client.vues.rechercheimages.resultats.ResultatRechercheImageVue;
|
- |
|
17 |
|
- |
|
18 |
import com.google.gwt.event.dom.client.ChangeEvent;
|
- |
|
19 |
import com.google.gwt.event.dom.client.ChangeHandler;
|
- |
|
20 |
import com.google.gwt.event.dom.client.HasChangeHandlers;
|
13 |
import org.tela_botanica.del.client.vues.rechercheimages.resultats.ResultatRechercheImageVue;
|
21 |
import com.google.gwt.user.client.ui.HasWidgets;
|
14 |
import com.google.gwt.user.client.ui.HasWidgets;
|
Line 22... |
Line 15... |
22 |
import com.google.gwt.user.client.ui.IsWidget;
|
15 |
import com.google.gwt.user.client.ui.IsWidget;
|
Line 23... |
Line 16... |
23 |
|
16 |
|
24 |
public class MoteurRechercheImagePresenteur {
|
- |
|
25 |
|
17 |
public class MoteurRechercheImagePresenteur {
|
26 |
public interface Vue extends IsWidget {
|
- |
|
27 |
|
18 |
|
28 |
public HasWidgets getZoneResultats();
|
- |
|
29 |
|
19 |
public interface Vue extends IsWidget {
|
30 |
public HasWidgets getZoneRecherche();
|
- |
|
31 |
|
20 |
public HasWidgets getZoneResultats();
|
Line 32... |
Line 21... |
32 |
public void ajouterVue(HasWidgets composite);
|
21 |
public HasWidgets getZoneRecherche();
|
33 |
|
- |
|
34 |
}
|
22 |
public void ajouterVue(HasWidgets composite);
|
35 |
|
- |
|
36 |
private Vue vue;
|
- |
|
37 |
|
- |
|
Line 38... |
Line 23... |
38 |
private final ProtocoleService protocoleService = MockDatasource.getInstance();
|
23 |
}
|
39 |
|
24 |
|
40 |
private String protocoleParDefaut = Protocole.ESTHETISME;
|
25 |
private Vue vue;
|
41 |
|
26 |
private final ProtocoleService protocoleService = new ProtocoleServiceConcret();
|
42 |
|
27 |
|
- |
|
28 |
/**
|
- |
|
29 |
* Constructeur
|
43 |
/**
|
30 |
* */
|
- |
|
31 |
public MoteurRechercheImagePresenteur(Vue vue) {
|
- |
|
32 |
this.vue = vue;
|
- |
|
33 |
//TODO: le code ci dessous sert à ne pas recharger les protocoles
|
- |
|
34 |
// à chaque fois, voir si on peut le factoriser quelque part
|
- |
|
35 |
if (CacheClient.getInstance().getProtocoleCourant() == null) {
|
44 |
* Constructeur
|
36 |
if(CacheClient.getInstance().getListeProtocoles() == null) {
|
- |
|
37 |
protocoleService.getProtocoles(new ProtocolesCallback() {
|
- |
|
38 |
@Override
|
- |
|
39 |
public void surProtocolesRecus(ProtocoleServiceResultat protocolesRecus) {
|
- |
|
40 |
CacheClient.getInstance().setListeProtocoles(protocolesRecus.getProtocoles());
|
- |
|
41 |
CacheClient.getInstance().setProtocoleCourant(protocolesRecus.getProtocoles().get(0));
|
45 |
* */
|
42 |
}
|
46 |
public MoteurRechercheImagePresenteur(Vue vue) {
|
43 |
});
|
Line 47... |
Line 44... |
47 |
this.vue = vue;
|
44 |
} else {
|
48 |
if (CacheClient.getInstance().getProtocoleCourant() == null) {
|
45 |
CacheClient.getInstance().setProtocoleCourant(CacheClient.getInstance().getListeProtocoles().get(0));
|
49 |
CacheClient.getInstance().setProtocoleCourant(protocoleService.getProtocole(protocoleParDefaut));
|
46 |
}
|
50 |
}
|
47 |
}
|
Line 51... |
Line -... |
51 |
}
|
- |
|
52 |
|
48 |
}
|
53 |
public void go(HasWidgets composite) {
|
49 |
|
54 |
vue.ajouterVue(composite);
|
50 |
public void go(HasWidgets composite) {
|
55 |
chargerMoteurRechercheAvancee();
|
51 |
vue.ajouterVue(composite);
|
56 |
}
|
52 |
chargerMoteurRechercheAvancee();
|