Subversion Repositories eFlore/Applications.del

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
15 benjamin 1
package org.tela_botanica.del.client.navigation.evenement;
9 benjamin 2
 
14 benjamin 3
import org.tela_botanica.del.client.cache.CacheClient;
22 aurelien 4
import org.tela_botanica.del.client.gestionhistorique.ConstantesNavigation;
9 benjamin 5
import org.tela_botanica.del.client.modeles.Observation;
15 benjamin 6
import org.tela_botanica.del.client.navigation.evenement.validationobservation.EvenementValidation;
7
import org.tela_botanica.del.client.navigation.evenement.validationobservation.GestionnaireEvenementValidation;
9 benjamin 8
 
9
import com.google.gwt.event.shared.HandlerManager;
10
import com.google.gwt.user.client.History;
11
 
14 benjamin 12
public class BusEvenementiel extends HandlerManager {
9 benjamin 13
 
14 benjamin 14
	private static BusEvenementiel instance;
9 benjamin 15
 
14 benjamin 16
	private BusEvenementiel() {
9 benjamin 17
		super(null);
18
		instance = this;
19
		createHandlers();
20
	}
21
 
14 benjamin 22
	public static BusEvenementiel getInstance() {
9 benjamin 23
		if (instance == null) {
14 benjamin 24
			instance = new BusEvenementiel();
9 benjamin 25
		}
26
		return instance;
27
	}
28
 
29
	private void createHandlers() {
14 benjamin 30
		addHandler(EvenementValidation.TYPE, new GestionnaireEvenementValidation() {
9 benjamin 31
 
32
			@Override
14 benjamin 33
			public void onValidateImage(EvenementValidation event) {
9 benjamin 34
				doValidateImage(event.getImageCel());
35
 
36
			}
37
		});
38
	}
39
 
40
	private void doValidateImage(Observation observation) {
14 benjamin 41
		CacheClient.getInstance().setCurrentObservation(observation);
42
		History.newItem(ConstantesNavigation.VALIDATION_PAGE, true);
9 benjamin 43
		History.fireCurrentHistoryState();
44
	}
45
 
46
}