| Line 7... |
Line 7... |
| 7 |
import org.tela_botanica.del.client.modeles.Protocole;
|
7 |
import org.tela_botanica.del.client.modeles.Protocole;
|
| 8 |
import org.tela_botanica.del.client.navigation.evenement.BusEvenementiel;
|
8 |
import org.tela_botanica.del.client.navigation.evenement.BusEvenementiel;
|
| 9 |
import org.tela_botanica.del.client.navigation.evenement.changementprotocole.EvenementChangementProtocole;
|
9 |
import org.tela_botanica.del.client.navigation.evenement.changementprotocole.EvenementChangementProtocole;
|
| 10 |
import org.tela_botanica.del.client.navigation.evenement.rechercheimage.EvenementRechercheImage;
|
10 |
import org.tela_botanica.del.client.navigation.evenement.rechercheimage.EvenementRechercheImage;
|
| 11 |
import org.tela_botanica.del.client.services.rest.ImageService;
|
11 |
import org.tela_botanica.del.client.services.rest.ImageService;
|
| - |
|
12 |
import org.tela_botanica.del.client.services.rest.ProtocoleService;
|
| 12 |
import org.tela_botanica.del.client.utils.MockDatasource;
|
13 |
import org.tela_botanica.del.client.utils.MockDatasource;
|
| Line 13... |
Line 14... |
| 13 |
|
14 |
|
| 14 |
import com.google.gwt.event.dom.client.ChangeEvent;
|
15 |
import com.google.gwt.event.dom.client.ChangeEvent;
|
| 15 |
import com.google.gwt.event.dom.client.ChangeHandler;
|
16 |
import com.google.gwt.event.dom.client.ChangeHandler;
|
| Line 19... |
Line 20... |
| 19 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
20 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
| 20 |
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
|
21 |
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
|
| 21 |
import com.google.gwt.event.dom.client.KeyCodes;
|
22 |
import com.google.gwt.event.dom.client.KeyCodes;
|
| 22 |
import com.google.gwt.event.dom.client.KeyPressEvent;
|
23 |
import com.google.gwt.event.dom.client.KeyPressEvent;
|
| 23 |
import com.google.gwt.event.dom.client.KeyPressHandler;
|
24 |
import com.google.gwt.event.dom.client.KeyPressHandler;
|
| 24 |
import com.google.gwt.user.client.Window;
|
- |
|
| 25 |
import com.google.gwt.user.client.ui.HasWidgets;
|
25 |
import com.google.gwt.user.client.ui.HasWidgets;
|
| 26 |
import com.google.gwt.user.client.ui.IsWidget;
|
26 |
import com.google.gwt.user.client.ui.IsWidget;
|
| Line 27... |
Line 27... |
| 27 |
|
27 |
|
| Line 37... |
Line 37... |
| 37 |
public abstract HasWidgets getZoneResultats();
|
37 |
public abstract HasWidgets getZoneResultats();
|
| 38 |
}
|
38 |
}
|
| Line 39... |
Line 39... |
| 39 |
|
39 |
|
| Line 40... |
Line 40... |
| 40 |
private Vue vue;
|
40 |
private Vue vue;
|
| - |
|
41 |
|
| 41 |
|
42 |
private final ImageService imageService = MockDatasource.getInstance();
|
| 42 |
private final ImageService dataSource = MockDatasource.getInstance();
|
43 |
private final ProtocoleService protocoleService = MockDatasource.getInstance();
|
| Line 43... |
Line 44... |
| 43 |
private String protocoleParDefaut = Protocole.IDENTIFICATION_AUTOMATIQUE;
|
44 |
private String protocoleParDefaut = Protocole.IDENTIFICATION_AUTOMATIQUE;
|
| 44 |
private List<Protocole> protocoles;
|
45 |
private List<Protocole> protocoles;
|
| 45 |
|
46 |
|
| 46 |
/**
|
47 |
/**
|
| 47 |
* Constructeur
|
48 |
* Constructeur
|
| Line 48... |
Line 49... |
| 48 |
* */
|
49 |
* */
|
| 49 |
public RechercheImagePresenteur(Vue vue) {
|
50 |
public RechercheImagePresenteur(Vue vue) {
|
| 50 |
this.vue = vue;
|
51 |
this.vue = vue;
|
| 51 |
|
52 |
|
| Line 52... |
Line 53... |
| 52 |
if (CacheClient.getInstance().getProtocoleCourant() == null) {
|
53 |
if (CacheClient.getInstance().getProtocoleCourant() == null) {
|
| 53 |
CacheClient.getInstance().setProtocoleCourant(dataSource.getProtocole(protocoleParDefaut));
|
54 |
CacheClient.getInstance().setProtocoleCourant(protocoleService.getProtocole(protocoleParDefaut));
|
| 54 |
}
|
55 |
}
|
| 55 |
}
|
56 |
}
|
| 56 |
|
57 |
|
| Line 57... |
Line 58... |
| 57 |
public void go(HasWidgets composite) {
|
58 |
public void go(HasWidgets composite) {
|
| 58 |
composite.add(vue.asWidget());
|
59 |
composite.add(vue.asWidget());
|
| 59 |
gererEvenements();
|
60 |
gererEvenements();
|
| 60 |
chargerProtocoles();
|
61 |
chargerProtocoles();
|
| 61 |
}
|
62 |
}
|
| 62 |
|
63 |
|
| 63 |
private void chargerProtocoles() {
|
64 |
private void chargerProtocoles() {
|
| Line 98... |
Line 99... |
| 98 |
}
|
99 |
}
|
| 99 |
});
|
100 |
});
|
| 100 |
}
|
101 |
}
|
| Line 101... |
Line 102... |
| 101 |
|
102 |
|
| 102 |
private void chargerImages(int debut, int fin) {
|
103 |
private void chargerImages(int debut, int fin) {
|
| 103 |
List<Image> imagesFromDatabase = dataSource.getImages(debut, fin);
|
104 |
List<Image> imagesFromDatabase = imageService.getImages(debut, fin);
|
| 104 |
EvenementRechercheImage evenementRechercheImage = new EvenementRechercheImage(imagesFromDatabase);
|
105 |
EvenementRechercheImage evenementRechercheImage = new EvenementRechercheImage(imagesFromDatabase);
|
| 105 |
BusEvenementiel.getInstance().fireEvent(evenementRechercheImage);
|
106 |
BusEvenementiel.getInstance().fireEvent(evenementRechercheImage);
|
| Line 106... |
Line 107... |
| 106 |
}
|
107 |
}
|