60 |
jpm |
1 |
package org.tela_botanica.client;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
|
|
4 |
import org.tela_botanica.client.modeles.ListeStructure;
|
|
|
5 |
import org.tela_botanica.client.modeles.ListeStructureAsyncDao;
|
|
|
6 |
|
|
|
7 |
import com.extjs.gxt.ui.client.Registry;
|
|
|
8 |
|
|
|
9 |
// TODO : le transformer en SINGLETON
|
|
|
10 |
public class Modele implements Rafraichissable {
|
|
|
11 |
|
|
|
12 |
public Modele() {
|
|
|
13 |
Registry.register(RegistreId.MODELE, this);
|
|
|
14 |
}
|
|
|
15 |
|
|
|
16 |
public void rafraichir(Object nouvelleDonnees) {
|
|
|
17 |
if (nouvelleDonnees instanceof ListeStructure) {
|
|
|
18 |
((Mediateur) Registry.get(RegistreId.MEDIATEUR)).afficherListeInstitutions((ListeStructure) nouvelleDonnees);
|
|
|
19 |
}
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
public void obtenirListeInstitutions() {
|
|
|
23 |
ListeStructureAsyncDao liDao = new ListeStructureAsyncDao(this);
|
|
|
24 |
liDao.obtenirListeInstitution();
|
|
|
25 |
}
|
|
|
26 |
}
|