Line 2... |
Line 2... |
2 |
|
2 |
|
3 |
import org.tela_botanica.client.Mediateur;
|
3 |
import org.tela_botanica.client.Mediateur;
|
4 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
4 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
5 |
import org.tela_botanica.client.composants.pagination.ProxyProjets;
|
5 |
import org.tela_botanica.client.composants.pagination.ProxyProjets;
|
- |
|
6 |
import org.tela_botanica.client.i18n.Constantes;
|
6 |
import org.tela_botanica.client.i18n.Constantes;
|
7 |
import org.tela_botanica.client.images.Images;
|
7 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
8 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
8 |
import org.tela_botanica.client.modeles.projet.Projet;
|
9 |
import org.tela_botanica.client.modeles.projet.Projet;
|
Line 9... |
Line 10... |
9 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
10 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
10 |
|
11 |
|
- |
|
12 |
import com.extjs.gxt.ui.client.data.ModelData;
|
11 |
import com.extjs.gxt.ui.client.data.ModelData;
|
13 |
import com.extjs.gxt.ui.client.data.ModelType;
|
12 |
import com.extjs.gxt.ui.client.data.ModelType;
|
14 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
13 |
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
15 |
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
14 |
import com.extjs.gxt.ui.client.event.KeyListener;
|
16 |
import com.extjs.gxt.ui.client.event.KeyListener;
|
- |
|
17 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
15 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
18 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
- |
|
19 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
16 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
20 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
17 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
21 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
- |
|
22 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
18 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
23 |
import com.extjs.gxt.ui.client.widget.form.Validator;
|
- |
|
24 |
import com.extjs.gxt.ui.client.widget.layout.BoxLayout;
|
19 |
import com.extjs.gxt.ui.client.widget.form.Validator;
|
25 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
- |
|
26 |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
|
20 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
27 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
Line 21... |
Line 28... |
21 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
28 |
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout;
|
22 |
import com.google.gwt.event.dom.client.KeyCodes;
|
29 |
import com.google.gwt.event.dom.client.KeyCodes;
|
23 |
|
30 |
|
24 |
public class FiltreVue extends ContentPanel implements Rafraichissable {
|
31 |
public class FiltreVue extends ContentPanel implements Rafraichissable {
|
Line 25... |
Line 32... |
25 |
private Mediateur mediateur = null;
|
32 |
private Mediateur mediateur = null;
|
Line -... |
Line 33... |
- |
|
33 |
private Constantes i18nC = null;
|
- |
|
34 |
private Sequenceur sequenceur = new Sequenceur();
|
26 |
private Constantes i18nC = null;
|
35 |
|
27 |
private Sequenceur sequenceur = new Sequenceur();
|
36 |
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
|
28 |
|
37 |
|
Line 29... |
Line 38... |
29 |
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
|
38 |
private Button annulerFiltre = null;
|
30 |
|
39 |
|
31 |
public FiltreVue(Mediateur mediateurCourrant) {
|
40 |
public FiltreVue(Mediateur mediateurCourrant) {
|
Line 32... |
Line 41... |
32 |
mediateur = mediateurCourrant;
|
41 |
mediateur = mediateurCourrant;
|
33 |
i18nC = Mediateur.i18nC;
|
42 |
i18nC = Mediateur.i18nC;
|
34 |
|
43 |
|
Line 68... |
Line 77... |
68 |
}
|
77 |
}
|
69 |
return retour;
|
78 |
return retour;
|
70 |
}
|
79 |
}
|
71 |
});
|
80 |
});
|
Line 72... |
Line -... |
72 |
|
- |
|
73 |
final Projet tousProjets = new Projet();
|
- |
|
74 |
tousProjets.set("nom", i18nC.tousProjets());
|
- |
|
75 |
|
81 |
|
76 |
// Ajout d'un écouteur pour le changement => enregistre la valeur courante du projet dans le registre
|
82 |
// Ajout d'un écouteur pour le changement => enregistre la valeur courante du projet dans le registre
|
77 |
projetsCombo.getCombo().addSelectionChangedListener(new SelectionChangedListener<ModelData>() {
|
83 |
projetsCombo.getCombo().addSelectionChangedListener(new SelectionChangedListener<ModelData>() {
|
78 |
public void selectionChanged(SelectionChangedEvent<ModelData> se) {
|
84 |
public void selectionChanged(SelectionChangedEvent<ModelData> se) {
|
79 |
if (se.getSelectedItem() != null) {
|
85 |
if (se.getSelectedItem() != null) {
|
80 |
mediateur.activerChargement(i18nC.chargement());
|
86 |
mediateur.activerChargement(i18nC.chargement());
|
81 |
Projet projet = new Projet (se.getSelectedItem());
|
87 |
Projet projet = new Projet (se.getSelectedItem());
|
- |
|
88 |
mediateur.selectionnerProjetCourant(projet);
|
- |
|
89 |
mediateur.desactiverChargement();
|
82 |
mediateur.selectionnerProjetCourant(projet);
|
90 |
annulerFiltre.setEnabled(true);
|
83 |
}
|
91 |
}
|
84 |
}
|
92 |
}
|
- |
|
93 |
});
|
- |
|
94 |
|
Line 85... |
Line 95... |
85 |
});
|
95 |
add(projetsCombo);
|
86 |
|
96 |
|
87 |
projetsCombo.getCombo().addKeyListener(new KeyListener() {
|
97 |
/** Bouton "annuler" filtre **/
|
88 |
public void componentKeyUp(ComponentEvent ce) {
|
98 |
annulerFiltre = new Button();
|
- |
|
99 |
annulerFiltre.setIcon(Images.ICONES.annuler());
|
- |
|
100 |
annulerFiltre.setEnabled(false);
|
89 |
projetsCombo.getCombo().setRawValue("Tous les projets");
|
101 |
add(annulerFiltre);
|
90 |
projetsCombo.getCombo().setValue(null);
|
102 |
|
- |
|
103 |
final Projet tousProjets = new Projet();
|
91 |
projetsCombo.getCombo().clearSelections();
|
104 |
tousProjets.set("nom", i18nC.tousProjets());
|
92 |
if (ce.getKeyCode() == KeyCodes.KEY_ENTER) {
|
105 |
|
93 |
mediateur.selectionnerProjetCourant(tousProjets);
|
106 |
annulerFiltre.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
94 |
projetsCombo.getCombo().setValue(tousProjets);
|
107 |
public void componentSelected(ButtonEvent ce) {
|
95 |
projetsCombo.getCombo().setVisible(false);
|
108 |
projetsCombo.getCombo().clear();
|
- |
|
109 |
mediateur.activerChargement(i18nC.chargement());
|
96 |
projetsCombo.getCombo().collapse();
|
110 |
mediateur.selectionnerProjetCourant(tousProjets);
|
97 |
projetsCombo.getCombo().setVisible(true);
|
111 |
mediateur.desactiverChargement();
|
98 |
}
|
112 |
annulerFiltre.setEnabled(false);
|
99 |
}
|
- |
|
100 |
});
|
- |
|
101 |
|
113 |
}
|
Line -... |
Line 114... |
- |
|
114 |
});
|
- |
|
115 |
}
|
102 |
add(projetsCombo);
|
116 |
|
103 |
}
|
117 |
|
104 |
|
118 |
|
105 |
public String getProjet() {
|
119 |
public String getProjet() {
|
106 |
if (projetsCombo.getValeur() != null) {
|
120 |
if (projetsCombo.getValeur() != null) {
|