Subversion Repositories eFlore/Applications.cel

Rev

Rev 2392 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2392 Rev 2602
Line 6... Line 6...
6
import java.util.List;
6
import java.util.List;
7
import java.util.Map;
7
import java.util.Map;
Line 8... Line 8...
8
 
8
 
9
import org.tela_botanica.client.interfaces.Rafraichissable;
9
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.modeles.dao.ListeReferentielChampsEtendusDAO;
-
 
11
import org.tela_botanica.client.modeles.objets.ListeChampsEtendus;
10
import org.tela_botanica.client.modeles.dao.ListeReferentielChampsEtendusDAO;
-
 
11
import org.tela_botanica.client.modeles.objets.ListeGroupesChampsEtendus;
Line 12... Line 12...
12
import org.tela_botanica.client.modeles.objets.ListeGroupesChampsEtendus;
12
import org.tela_botanica.client.util.autocompletion.AutoCompletionComboBox;
-
 
13
 
-
 
14
import com.google.gwt.core.client.Callback;
13
 
15
import com.google.gwt.event.dom.client.ChangeEvent;
14
import com.google.gwt.core.client.Callback;
16
import com.google.gwt.event.dom.client.ChangeHandler;
15
import com.google.gwt.user.client.Timer;
17
import com.google.gwt.http.client.Response;
16
import com.google.gwt.user.client.Window;
18
import com.google.gwt.user.client.Window;
-
 
19
import com.google.gwt.user.client.ui.HTML;
-
 
20
import com.google.gwt.user.client.ui.HorizontalPanel;
17
import com.google.gwt.user.client.ui.HTML;
21
import com.google.gwt.user.client.ui.Label;
18
import com.google.gwt.user.client.ui.HorizontalPanel;
22
import com.google.gwt.user.client.ui.ListBox;
19
import com.gwtext.client.core.EventCallback;
23
import com.gwtext.client.core.EventCallback;
20
import com.gwtext.client.core.EventObject;
-
 
21
import com.gwtext.client.core.Ext;
-
 
22
import com.gwtext.client.core.ListenerConfig;
-
 
23
import com.gwtext.client.data.ArrayReader;
-
 
24
import com.gwtext.client.data.FieldDef;
-
 
25
import com.gwtext.client.data.MemoryProxy;
-
 
26
import com.gwtext.client.data.Record;
-
 
27
import com.gwtext.client.data.RecordDef;
-
 
28
import com.gwtext.client.data.SimpleStore;
-
 
29
import com.gwtext.client.data.Store;
24
import com.gwtext.client.core.EventObject;
30
import com.gwtext.client.data.StringFieldDef;
25
import com.gwtext.client.core.Ext;
31
import com.gwtext.client.widgets.Button;
26
import com.gwtext.client.widgets.Button;
32
import com.gwtext.client.widgets.Panel;
-
 
33
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
 
34
import com.gwtext.client.widgets.form.ComboBox;
27
import com.gwtext.client.widgets.Panel;
35
import com.gwtext.client.widgets.form.Field;
-
 
36
import com.gwtext.client.widgets.form.FormPanel;
28
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
Line 37... Line 29...
37
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
29
import com.gwtext.client.widgets.form.FormPanel;
38
import com.gwtext.client.widgets.layout.FormLayout;
30
import com.gwtext.client.widgets.layout.FormLayout;
Line 39... Line -...
39
 
-
 
40
@SuppressWarnings("unchecked")
-
 
41
public abstract class FormulaireSaisieChampEtendu extends FormPanel implements Rafraichissable {
-
 
42
	
-
 
43
	private final int KEY_ALT = 18;
-
 
44
	private final int KEY_BACKSPACE = 8;
-
 
45
	private final int KEY_CTRL = 17;
-
 
46
	private final int KEY_DELETE = 46;
-
 
47
	private final int KEY_DOWN = 40;
-
 
48
	private final int KEY_END = 35;
-
 
49
	private final int KEY_ENTER = 13;
-
 
50
	private final int KEY_ESCAPE = 27;
-
 
51
	private final int KEY_HOME = 36;
-
 
52
	private final int KEY_LEFT = 37;
-
 
53
	private final int KEY_PAGEDOWN = 34;
-
 
54
	private final int KEY_PAGEUP = 33;
-
 
55
	private final int KEY_RIGHT = 39;
-
 
56
	private final int KEY_SHIFT = 16;
31
 
57
	private final int KEY_TAB = 9;
-
 
58
	private final int KEY_UP = 38;
32
@SuppressWarnings("unchecked")
59
	
33
public abstract class FormulaireSaisieChampEtendu extends FormPanel implements Rafraichissable {
60
	final ComboBox nChamp;
34
	
61
	final String resultTplRefPerso = "<div class=\"search-item-ref\">{label_fmt}</div>"; 
35
	final AutoCompletionComboBox nChamp;
Line 62... Line 36...
62
	Button ajouterChampsEtenduEtFermer;
36
	Button ajouterChampsEtenduEtFermer;
-
 
37
	Button ajouterChampsEtendu;
63
	Button ajouterChampsEtendu;
38
	Button annulerAjouterChampEtendu;
64
	Button annulerAjouterChampEtendu;
39
	String idChamp = null;
Line 65... Line 40...
65
	String idChamp = null;
40
	
-
 
41
	Panel conteneurGroupesChampsEtendus;
Line 66... Line -...
66
	
-
 
67
	Panel conteneurGroupesChampsEtendus;
-
 
68
	final ComboBox groupesChampsEtendus;
-
 
69
	HTML indicationSaisieGroupe;
42
	Panel conteneurlabelGroupe;
70
	
-
 
71
	private static ListeGroupesChampsEtendus cacheGroupes;
-
 
72
	
43
	ListBox listeGroupeChampsEtendus;
73
	private Timer timer = null;
-
 
Line 74... Line 44...
74
	
44
	HTML indicationSaisieGroupe;
75
	private static Map<String, String> cacheClesValeur;
45
	
76
	private HTML descriptionChamp = null;
46
	private static ListeGroupesChampsEtendus cacheGroupes;
77
	
47
	private static Map<String, String> cacheLabelsCle;
Line 87... Line 57...
87
		indicationSaisieGroupe = new HTML("Vous pouvez ajouter plusieurs champs à la fois correspondant à un groupe "+
57
		indicationSaisieGroupe = new HTML("Vous pouvez ajouter plusieurs champs à la fois correspondant à un groupe "+
88
				"par exemple les champs des projet 'sauvages de ma rue' ou 'florilèges', etc... <br />"+
58
				"par exemple les champs des projet 'sauvages de ma rue' ou 'florilèges', etc... <br />"+
89
				"De nouveaux groupes seront ajoutés régulièrement en fonction des champs les plus utilisés");
59
				"De nouveaux groupes seront ajoutés régulièrement en fonction des champs les plus utilisés");
90
		indicationSaisieGroupe.addStyleName("aideCreerChampEtendu");
60
		indicationSaisieGroupe.addStyleName("aideCreerChampEtendu");
Line 91... Line 61...
91
		
61
		
92
		groupesChampsEtendus = new ComboBox();
62
		conteneurlabelGroupe = new Panel();
93
		groupesChampsEtendus.setWidth("350px");
63
		conteneurlabelGroupe.setStyleName("panneauEnLigne");
94
		groupesChampsEtendus.setLabel("Ajouter un groupe de champs");
64
		conteneurlabelGroupe.addStyleName("selecteurGroupeEtendus");
95
		groupesChampsEtendus.setDisplayField("label") ;
65
		conteneurlabelGroupe.setBorder(false);
96
		groupesChampsEtendus.setValueField("cle");
66
		Label labelGroupeChampsEtendus = new Label("Ajouter un groupe de champs :");
97
		groupesChampsEtendus.setEditable(false);
67
		listeGroupeChampsEtendus = new ListBox();
98
		groupesChampsEtendus.setHideTrigger(false);
68
		listeGroupeChampsEtendus.setWidth("315px");
99
		groupesChampsEtendus.setForceSelection(true);
69
		conteneurlabelGroupe.add(labelGroupeChampsEtendus);
100
		groupesChampsEtendus.setCls("champ-separation");
-
 
Line 101... Line 70...
101
		groupesChampsEtendus.setValue("");
70
		conteneurlabelGroupe.add(listeGroupeChampsEtendus);
102
		
71
		
103
		conteneurGroupesChampsEtendus = new Panel();
72
		conteneurGroupesChampsEtendus = new Panel();
104
		conteneurGroupesChampsEtendus.setBorder(false);
73
		conteneurGroupesChampsEtendus.setBorder(false);
Line 124... Line 93...
124
		indicationSaisie.addStyleName("aideCreerChampEtendu");
93
		indicationSaisie.addStyleName("aideCreerChampEtendu");
125
		add(indicationSaisie);
94
		add(indicationSaisie);
Line 126... Line 95...
126
		
95
		
127
		HorizontalPanel hp = new HorizontalPanel();
96
		HorizontalPanel hp = new HorizontalPanel();
-
 
97
		hp.setBorderWidth(0);
128
		hp.setBorderWidth(0);
98
		
129
				
99
		
130
		nChamp = new ComboBox("Nom du champ", "nom_champ_etendu");
100
		nChamp = new AutoCompletionComboBox("Nom du champ", ListeReferentielChampsEtendusDAO.getUrlRequeteNomsChampsEtendus()) {
131
		nChamp.setWidth("350px");
101
			@Override
132
		nChamp.setTpl(resultTplRefPerso);
102
			protected Map<String, String> parserResultatRequete(
-
 
103
					Response response) {
133
		nChamp.setMode(ComboBox.REMOTE);
104
				Map<String, String> clesLabels = ListeReferentielChampsEtendusDAO.parserRetourListeNomsChampsEtendus(response);
134
		nChamp.setItemSelector("div.search-item-ref");
105
				cacheLabelsCle = new HashMap<String, String>();
135
		nChamp.setTypeAhead(false);  
106
				for(Map.Entry<String, String> entry : clesLabels.entrySet()){
-
 
107
					cacheLabelsCle.put(entry.getValue(), entry.getKey());
136
		nChamp.setLoadingText("Recherche...");  
108
				}
-
 
109
				return clesLabels;
-
 
110
			}
-
 
111
 
137
		nChamp.setHideTrigger(true);
112
			@Override
-
 
113
			protected void onSelectionValeur() {
-
 
114
				telechargerEtAfficherDescriptionChamps(cacheLabelsCle.get(nChamp.getRawValue()));
-
 
115
			}
-
 
116
 
138
		nChamp.setValidateOnBlur(false);
117
			@Override
-
 
118
			protected void onValidationSaisie() {
-
 
119
				// rien à faire ici
-
 
120
			}
139
		Store store = initStoreChampsEtendusVide();
121
 
-
 
122
			@Override
-
 
123
			protected void onModificationValeur() {
-
 
124
				// rien à faire ici non plus		
-
 
125
			}
-
 
126
			
-
 
127
		};
140
		store.load();
128
		
141
	    nChamp.setStore(store);
129
		nChamp.addStyleName("panneauEnLigne");
Line 142... Line 130...
142
		add(nChamp);
130
		add(nChamp);
143
		
131
		
144
		descriptionChamp = new HTML();
132
		descriptionChamp = new HTML();
Line 159... Line 147...
159
		
147
		
160
		ajouterListeners();
148
		ajouterListeners();
Line 161... Line 149...
161
	}
149
	}
162
 
-
 
163
	private void ajouterListeners() {
-
 
164
		ListenerConfig listenerConfigAutocompletion=new ListenerConfig();
-
 
165
	    listenerConfigAutocompletion.setDelay(200);
-
 
166
	    listenerConfigAutocompletion.setStopPropagation(false);
150
 
167
	    listenerConfigAutocompletion.setStopEvent(true);
151
	private void ajouterListeners() {
168
		
-
 
169
	    nChamp.addKeyPressListener(new EventCallback() {
152
		 
170
 
153
	    listeGroupeChampsEtendus.addChangeHandler(new ChangeHandler() {		
171
			@Override
-
 
172
			public void execute(EventObject e) {
-
 
173
 
-
 
174
				switch(e.getKey()) {
-
 
175
		    	      
-
 
176
					case KEY_ALT:
-
 
177
		    	      case KEY_CTRL:
-
 
178
		    	      case KEY_END:
-
 
179
		    	      case KEY_HOME:
-
 
180
		    	      case KEY_LEFT:
-
 
181
		    	      case KEY_PAGEDOWN:
-
 
182
		    	      case KEY_PAGEUP:
-
 
183
		    	      case KEY_RIGHT:
-
 
184
		    	      case KEY_SHIFT:
-
 
185
		    	      case KEY_TAB:
-
 
186
		    	      case KEY_UP:
-
 
187
	    	        break;
-
 
188
	    	        
-
 
189
		    	  case KEY_ENTER:
-
 
190
  	    	    	  if(rdSelectionne != null) {
-
 
191
  	    	    		nChamp.setValue(rdSelectionne.getAsString("label"));
-
 
192
  	    	    		valeurBrute = rdSelectionne.getAsString("cle");
-
 
193
  	    	    	  }
-
 
194
	              break;
-
 
195
	    	        
154
			@Override
196
		    	    case KEY_DOWN:
-
 
197
  	    	    	  if(nChamp.getValueAsString().isEmpty() && !nChamp.isExpanded()) {
-
 
198
  	    	    		obtenirListeValeurs("*");
-
 
199
  	    	    	  }
-
 
200
  	    	    	break;
-
 
201
	    	        
-
 
202
		    	    case KEY_ESCAPE:
-
 
203
		    	    	surAnnulation();
-
 
204
		    	    break;
-
 
205
		    	    
-
 
206
		    	    default:
-
 
207
		    	    	if(timer != null) {
-
 
208
		    	    		timer.cancel();
-
 
209
		    	    	}
-
 
210
		    	    	timer = new Timer() {
-
 
211
							
-
 
212
							@Override
-
 
213
							public void run() {
-
 
214
			  	    	      	obtenirListeValeurs();
-
 
215
							}
-
 
216
						};
-
 
217
						timer.schedule(300);
-
 
218
						valeurBrute = nChamp.getRawValue();
-
 
219
						nChamp.setRawValue(valeurBrute);
155
			public void onChange(ChangeEvent event) {
220
				}
-
 
221
			}
-
 
222
	    },listenerConfigAutocompletion);
-
 
223
		
-
 
224
	    nChamp.addListener(new ComboBoxListenerAdapter() {  
-
 
225
            @Override
-
 
226
			public void onSelect(ComboBox comboBox, Record record, int index) { 
-
 
227
            	rdSelectionne = record;
-
 
228
            	telechargerEtAfficherDescriptionChamps(rdSelectionne.getAsString("cle"));
-
 
229
            	nChamp.setRawValue(rdSelectionne.getAsString("label"));
-
 
230
            	valeurBrute = rdSelectionne.getAsString("cle");
-
 
231
            }
-
 
232
 
-
 
233
			@Override
-
 
234
			public void onBlur(Field field) {
-
 
235
            	if(rdSelectionne != null && !rdSelectionne.getAsString("cle").equals(valeurBrute)) {
-
 
236
            		nChamp.setRawValue(valeurBrute);         		
-
 
237
            	} 
-
 
238
            	telechargerEtAfficherDescriptionChamps(valeurBrute);
-
 
239
            }
-
 
240
         });
-
 
241
	    
-
 
242
	    groupesChampsEtendus.addListener(new ComboBoxListenerAdapter() {  
-
 
243
			@Override
-
 
244
			public void onSelect(ComboBox comboBox, Record record, int index) {  
-
 
245
            	groupeSelectionne = record;
156
				groupeSelectionne = listeGroupeChampsEtendus.getValue(listeGroupeChampsEtendus.getSelectedIndex());
Line 246... Line 157...
246
            }
157
			}
247
	     });
158
		});
248
	    
159
	    
249
	    ajouterChampsEtenduEtFermer.addListener(new ButtonListenerAdapter() {			
160
	    ajouterChampsEtenduEtFermer.addListener(new ButtonListenerAdapter() {			
250
			@Override
161
			@Override
251
			public void onClick(Button button, EventObject e) {
162
			public void onClick(Button button, EventObject e) {
252
				if(doitAjouterGroupe()) {
163
				if(doitAjouterGroupe()) {
253
					surValidationMultiple(renvoyerListeChampsEtendus(groupeSelectionne.getAsString("cle")));
164
					surValidationMultiple(renvoyerListeChampsEtendus(groupeSelectionne));
254
				} else {
165
				} else {
255
					if(champEtenduEstValide()) {
166
					if(champEtenduEstValide()) {
Line 280... Line 191...
280
			}
191
			}
281
		});
192
		});
282
	}
193
	}
Line 283... Line 194...
283
	
194
	
284
	private void raz() {
-
 
285
		timer = null;
195
	private void raz() {
286
		idChamp = null;
196
		idChamp = null;
287
		nChamp.clearValue();
197
		nChamp.reset();
288
		nChamp.focus();
198
		nChamp.focus();
Line 289... Line 199...
289
	}
199
	}
290
	
200
	
291
	private ChampSaisieEtendu validerEtRenvoyerChampEtendu() {
-
 
292
		String valeurChamp = nChamp.getRawValue();
-
 
293
		// Valeur contient soit la clé, soit le label s'il existe
201
	private ChampSaisieEtendu validerEtRenvoyerChampEtendu() {
294
		// valeur brute contient toujours la clé
202
		String labelChamp = nChamp.getRawValue();
295
		// TODO: utiliser les champs de google et pas ceux de GWT-EXT qui puent du cul
203
		String cleChamp = cacheLabelsCle.containsKey(labelChamp) ? cacheLabelsCle.get(labelChamp) : labelChamp;
296
		ChampSaisieEtendu retour = new ChampSaisieEtendu(valeurChamp, valeurBrute);
204
		ChampSaisieEtendu retour = new ChampSaisieEtendu(labelChamp, cleChamp, ListeReferentielChampsEtendusDAO.getUrlRequeteValeursChampEtendu(cleChamp));
297
		retour.setId(valeurBrute);
205
		retour.setId(cleChamp);
Line 298... Line 206...
298
		return retour;
206
		return retour;
299
	}
207
	}
300
	
208
	
301
	private List<ChampSaisieEtendu> renvoyerListeChampsEtendus(String groupe) {	
209
	private List<ChampSaisieEtendu> renvoyerListeChampsEtendus(String groupe) {	
302
		List<ChampSaisieEtendu> champsDuGroupe = new ArrayList<ChampSaisieEtendu>();
210
		List<ChampSaisieEtendu> champsDuGroupe = new ArrayList<ChampSaisieEtendu>();
303
		HashMap<String, String> listeChampsEtendus = cacheGroupes.get(groupe);
211
		HashMap<String, String> listeChampsEtendus = cacheGroupes.get(groupe);
304
		for (Iterator<String> iterator = listeChampsEtendus.keySet().iterator(); iterator.hasNext();) {
212
		for (Iterator<String> iterator = listeChampsEtendus.keySet().iterator(); iterator.hasNext();) {
305
			String cle = iterator.next();
213
			String cle = iterator.next();
306
			String label = listeChampsEtendus.get(cle);
214
			String label = listeChampsEtendus.get(cle);
Line 307... Line 215...
307
			ChampSaisieEtendu champ = new ChampSaisieEtendu(label, cle);
215
			ChampSaisieEtendu champ = new ChampSaisieEtendu(label, cle,  ListeReferentielChampsEtendusDAO.getUrlRequeteValeursChampEtendu(cle));
308
			champsDuGroupe.add(champ);
216
			champsDuGroupe.add(champ);
Line 309... Line 217...
309
		}
217
		}
310
 
218
 
311
		return champsDuGroupe;
219
		return champsDuGroupe;
Line 312... Line 220...
312
	}
220
	}
313
	
221
	
314
	private boolean doitAjouterGroupe() {
222
	private boolean doitAjouterGroupe() {
315
		return groupeSelectionne != null && !groupeSelectionne.getAsString("cle").equals("");
223
		return groupeSelectionne != null && !groupeSelectionne.equals("");
Line 316... Line -...
316
	}
-
 
317
	
-
 
318
	private boolean champEtenduEstValide() {
-
 
319
		String valeurChamp = nChamp.getRawValue();
-
 
320
		return (valeurChamp != null && !valeurChamp.isEmpty());
-
 
321
	}
-
 
322
	
-
 
323
	private boolean estUnChampSelectionne(String valeur) {
-
 
324
		return cacheClesValeur.containsValue(valeur);
-
 
325
	}
-
 
326
	
-
 
327
	private void obtenirListeValeurs() {
-
 
328
		obtenirListeValeurs(nChamp.getRawValue());
-
 
329
	}
224
	}
330
	
225
	
331
	private void obtenirListeValeurs(String valeur) {
226
	private boolean champEtenduEstValide() {
332
		ListeReferentielChampsEtendusDAO lrce = new ListeReferentielChampsEtendusDAO(null);
227
		String valeurChamp = nChamp.getRawValue();
333
		lrce.obtenirListeNomsChampsEtendus(this, valeur+"*");
228
		return (valeurChamp != null && !valeurChamp.isEmpty());
Line 334... Line 229...
334
	}
229
	}
335
	
-
 
336
	public abstract void surAjout(ChampSaisieEtendu champ);
-
 
337
	public abstract void surAjoutMultiple(List<ChampSaisieEtendu> champs);
-
 
338
	public abstract void surValidation(ChampSaisieEtendu champ);
-
 
339
	public abstract void surValidationMultiple(List<ChampSaisieEtendu> champs);
-
 
340
	public abstract void surAnnulation();
-
 
341
	
-
 
342
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {	
-
 
343
		
-
 
344
		if(nouvelleDonnees instanceof ListeChampsEtendus) {
-
 
345
			int i = 0;
-
 
346
					
-
 
347
			ListeChampsEtendus clesLabels = (ListeChampsEtendus)nouvelleDonnees;	
-
 
348
			cacheClesValeur = clesLabels;
-
 
349
			Object[][] refData = new Object[clesLabels.keySet().size()][3];
-
 
350
			
-
 
351
			for (Iterator<String> it = clesLabels.keySet().iterator(); it.hasNext();) 
-
 
352
			{
-
 
353
				String cle = it.next();
-
 
354
				String label = clesLabels.get(cle);
-
 
355
				
-
 
356
				refData[i][0]= cle;
-
 
357
				refData[i][1]= label;
-
 
358
				if(cle.equals(label.toLowerCase())) {
-
 
359
					refData[i][2]= label;
-
 
360
				} else {
-
 
361
					refData[i][2]= label+" ("+cle+")";
-
 
362
				}
-
 
363
 
-
 
364
				i++;
-
 
365
			}
-
 
366
			
-
 
367
			FieldDef defCle = new StringFieldDef("cle");
-
 
368
			FieldDef defLabel = new StringFieldDef("label");
-
 
369
			FieldDef defLabelFmt = new StringFieldDef("label_fmt");
-
 
370
			FieldDef[] defTab = {defCle, defLabel, defLabelFmt};
-
 
371
			
-
 
372
			RecordDef rd = new RecordDef(defTab);
-
 
373
			
-
 
374
			final MemoryProxy dataProxy = new MemoryProxy(refData);
-
 
375
			final ArrayReader reader = new ArrayReader(rd);		
230
	
376
							
231
	public abstract void surAjout(ChampSaisieEtendu champ);
-
 
232
	public abstract void surAjoutMultiple(List<ChampSaisieEtendu> champs);
-
 
233
	public abstract void surValidation(ChampSaisieEtendu champ);
377
			Store store=new Store(dataProxy,reader);
234
	public abstract void surValidationMultiple(List<ChampSaisieEtendu> champs);
-
 
235
	public abstract void surAnnulation();
-
 
236
	
378
			
237
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {			
379
			nChamp.setStore(store);
238
		if(nouvelleDonnees instanceof ListeGroupesChampsEtendus) {
380
			store.load();
239
			cacheGroupes  = (ListeGroupesChampsEtendus)nouvelleDonnees;
381
		}
240
			listeGroupeChampsEtendus.addItem("...");
382
		
241
			for (Iterator<String> iterator = cacheGroupes.keySet().iterator(); iterator.hasNext();) {
383
		if(nouvelleDonnees instanceof ListeGroupesChampsEtendus) {
242
				listeGroupeChampsEtendus.addItem(iterator.next());
384
			cacheGroupes  = (ListeGroupesChampsEtendus)nouvelleDonnees;
243
			}
Line 420... Line 279...
420
			});
279
			});
421
		} else {
280
		} else {
422
			descriptionChamp.setHTML("<span class=\"descriptionChampEtenduTitre\">Description :</span> "+description);
281
			descriptionChamp.setHTML("<span class=\"descriptionChampEtenduTitre\">Description :</span> "+description);
423
		}
282
		}
424
    }
283
    }
425
	
-
 
426
	private Store getGroupesChampsEtendusStore(ListeGroupesChampsEtendus listeGroupesChampsEtendus) {
-
 
427
		int i = 1;		
-
 
428
		Object[][] valeurs = new Object[listeGroupesChampsEtendus.size()+1][2];
-
 
429
		
-
 
430
		valeurs[0][0] = "...";
-
 
431
		valeurs[0][1] = "";
-
 
432
		if(listeGroupesChampsEtendus.size() > 0) {
-
 
433
			for (Iterator<String> it = listeGroupesChampsEtendus.keySet().iterator(); it.hasNext();) 
-
 
434
			{
-
 
435
				String cle = it.next();
-
 
436
				valeurs[i][0]= cle;
-
 
437
				valeurs[i][1]= cle;
-
 
438
				i++;
-
 
439
			}
-
 
440
		}					
-
 
441
		SimpleStore store = new SimpleStore(new String[] {"label","cle"},valeurs);
-
 
442
		store.load();
-
 
443
		return store;
-
 
444
	}
-
 
445
	
-
 
446
	private Store initStoreChampsEtendusVide() {
-
 
447
		Object[][] refData = new Object[0][1];
-
 
448
		
-
 
449
		FieldDef defLabel = new StringFieldDef("label");
-
 
450
		FieldDef defCle = new StringFieldDef("cle");
-
 
451
		FieldDef[] defTab = {defLabel, defCle};
-
 
452
		
-
 
453
		RecordDef rd = new RecordDef(defTab);
-
 
454
		
-
 
455
		final MemoryProxy dataProxy = new MemoryProxy(refData);
-
 
456
		final ArrayReader reader = new ArrayReader(rd);		
-
 
457
						
-
 
458
		Store store = new Store(dataProxy,reader);
-
 
459
		
-
 
460
		return store;
-
 
461
	}
-
 
462
}
284
}