Subversion Repositories eFlore/Applications.cel

Rev

Rev 680 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
669 aurelien 1
package org.tela_botanica.client.vues.image.filtres;
5 aperonnet 2
 
3
import org.tela_botanica.client.image.ImageMediateur;
4
import org.tela_botanica.client.interfaces.Filtrable;
5
 
6
import com.google.gwt.user.client.ui.Label;
7
import com.gwtext.client.widgets.Panel;
8
import com.gwtext.client.widgets.form.Checkbox;
9
 
10
public class SelectionFiltreVue extends Panel implements Filtrable {
11
 
12
	private ImageMediateur iMediateur = null;
13
 
14
	private boolean filtreModifie = false;
15
 
16
	private Checkbox check = null;
17
 
18
	@SuppressWarnings("unused")
19
	private SelectionFiltreVue()
20
	{
21
		super() ;
22
	}
23
 
24
	public SelectionFiltreVue(ImageMediateur im) {
25
 
26
		super();
27
		iMediateur = im ;
28
		Label labelRecherche = new Label(
29
				"Afficher uniquement les images dans le tampon :");
30
		add(labelRecherche);
31
		setBorder(false);
32
		setPaddings(5);
33
 
34
		/*
35
		 * combo = new ComboBox() ; String tout = "toutes les images "; String
36
		 * selection = "dans le tampon seulement" ; Object[][] data = new
37
		 * Object[2][2]; data[0][0] = 1 ; data[0][1] = tout ; data[1][0] = 2 ;
38
		 * data[1][1] = selection ;
39
		 *  // creation du store qui les contient FieldDef defIdChoix = new
40
		 * IntegerFieldDef("id_choix"); FieldDef defNomChoix = new
41
		 * StringFieldDef("nom_choix");
42
		 *
43
		 * FieldDef[] defTab = {defIdChoix, defNomChoix}; RecordDef rd = new
44
		 * RecordDef(defTab) ;
45
		 *
46
		 * final MemoryProxy dataProxy = new MemoryProxy(data); final
47
		 * ArrayReader reader = new ArrayReader(rd);
48
		 *
49
		 * st = new Store(dataProxy, reader); st.load() ; combo.setStore(st) ;
50
		 * combo.setGrow(true) ; combo.setMode(ComboBox.LOCAL);
51
		 * combo.setEditable(false) ; //combo.setDisplayField("nom_choix") ;
52
		 * add(combo) ;
53
		 */
54
 
55
		check = new Checkbox();
56
		check.setChecked(false) ;
57
		add(check);
58
 
59
	}
60
 
1292 aurelien 61
	@Override
5 aperonnet 62
	public boolean renvoyerEtatFiltre() {
63
 
64
		return filtreModifie;
65
	}
66
 
1292 aurelien 67
	@Override
5 aperonnet 68
	public String renvoyerNomFiltre() {
69
 
70
		return "Filtre par tampon";
71
	}
72
 
1292 aurelien 73
	@Override
5 aperonnet 74
	public String[] renvoyerValeursAFiltrer() {
75
 
76
		if (check.getValue()) {
77
 
78
			String[] val = { "ci_id_tampon", iMediateur.renvoyerSelection() };
79
			return val;
80
		}
81
 
82
		String[] val = { "ci_id_tampon", "" };
83
		return val;
84
	}
85
 
1292 aurelien 86
	@Override
5 aperonnet 87
	public void valider() {
88
 
89
		filtreModifie = true;
90
 
91
	}
92
 
680 aurelien 93
	@Override
94
	public void viderFiltre() {
95
		check.setChecked(false);
96
	}
97
 
5 aperonnet 98
}