Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 63 Rev 99
Line 7... Line 7...
7
import org.tela_botanica.client.modeles.ListeObservation;
7
import org.tela_botanica.client.modeles.ListeObservation;
8
import org.tela_botanica.client.modeles.Observation;
8
import org.tela_botanica.client.modeles.Observation;
Line 9... Line 9...
9
 
9
 
10
import com.google.gwt.user.client.Window;
10
import com.google.gwt.user.client.Window;
-
 
11
import com.google.gwt.user.client.ui.MouseListenerAdapter;
11
import com.google.gwt.user.client.ui.MouseListenerAdapter;
12
import com.gwtext.client.data.Record;
12
import com.gwtext.client.data.SimpleStore;
13
import com.gwtext.client.data.SimpleStore;
13
import com.gwtext.client.data.Store;
14
import com.gwtext.client.data.Store;
14
import com.gwtext.client.dd.DragSource;
15
import com.gwtext.client.dd.DragSource;
15
import com.gwtext.client.dd.DropTarget;
16
import com.gwtext.client.dd.DropTarget;
16
import com.gwtext.client.dd.DropTargetConfig;
17
import com.gwtext.client.dd.DropTargetConfig;
-
 
18
import com.gwtext.client.widgets.Component;
17
import com.gwtext.client.widgets.Component;
19
import com.gwtext.client.widgets.Toolbar;
18
import com.gwtext.client.widgets.event.ComponentListenerAdapter;
20
import com.gwtext.client.widgets.event.ComponentListenerAdapter;
19
import com.gwtext.client.widgets.event.ContainerListener;
21
import com.gwtext.client.widgets.event.ContainerListener;
20
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
22
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
-
 
23
import com.gwtext.client.widgets.event.PanelListenerAdapter;
-
 
24
import com.gwtext.client.widgets.form.ComboBox;
21
import com.gwtext.client.widgets.event.PanelListenerAdapter;
25
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
22
import com.gwtext.client.widgets.grid.ColumnConfig;
26
import com.gwtext.client.widgets.grid.ColumnConfig;
23
import com.gwtext.client.widgets.grid.ColumnModel;
27
import com.gwtext.client.widgets.grid.ColumnModel;
24
import com.gwtext.client.widgets.grid.GridDragData;
28
import com.gwtext.client.widgets.grid.GridDragData;
25
import com.gwtext.client.widgets.grid.GridPanel;
29
import com.gwtext.client.widgets.grid.GridPanel;
26
import com.gwtext.client.widgets.grid.event.GridListener;
30
import com.gwtext.client.widgets.grid.event.GridListener;
27
import com.gwtext.client.widgets.grid.event.GridListenerAdapter;
31
import com.gwtext.client.widgets.grid.event.GridListenerAdapter;
-
 
32
import com.gwtext.client.core.EventObject;
-
 
33
import com.gwtext.client.core.Ext;
28
import com.gwtext.client.core.EventObject;
34
import com.gwtext.client.core.ExtElement;
Line 29... Line 35...
29
import com.gwtext.client.dd.DragData;
35
import com.gwtext.client.dd.DragData;
30
 
36
 
31
/**
37
/**
Line 50... Line 56...
50
	 */
56
	 */
51
	private ColumnModel colModel = null ;
57
	private ColumnModel colModel = null ;
Line 52... Line 58...
52
	
58
	
Line -... Line 59...
-
 
59
	private SimpleStore store = null ;
-
 
60
	
-
 
61
	//private BarrePaginationVue pgBar = new BarrePaginationVue(iMediateur) ;
-
 
62
	
-
 
63
	private Toolbar bt = new Toolbar() ;
-
 
64
	
-
 
65
	/**
-
 
66
	 * Combobox permettant de selectionner le mode
-
 
67
	 * modification ou bien création
-
 
68
	 */
-
 
69
	private ComboBox selecteurMode = new ComboBox();
-
 
70
	
-
 
71
	Store storeMode = null ;
-
 
72
 
53
	private SimpleStore store = null ;
73
	private boolean liaison;
54
	
74
	
55
	/**
75
	/**
56
	 * Constructeur avec arguments
76
	 * Constructeur avec arguments
57
	 * @param im le médiateur à associer à la vue
77
	 * @param im le médiateur à associer à la vue
Line 83... Line 103...
83
 		this.setEnableDragDrop(true);
103
 		this.setEnableDragDrop(true);
84
 		this.setDdGroup("DragGroupName");
104
 		this.setDdGroup("DragGroupName");
85
        store.load();       
105
        store.load();       
86
		setStore(store) ;
106
		setStore(store) ;
Line -... Line 107...
-
 
107
		
-
 
108
		//setBottomToolbar(pgBar) ;
-
 
109
		
-
 
110
		Object[][] mode = {{"toutes les observations",false} , {"observations liées", true} };
-
 
111
		storeMode = new SimpleStore(new String[] { "nom_mode", "mode" },
-
 
112
				mode);
-
 
113
		storeMode.load();
-
 
114
		selecteurMode.setStore(storeMode);
-
 
115
		selecteurMode.setDisplayField("nom_mode") ;
-
 
116
		selecteurMode.setLabel("mode ") ;
-
 
117
		selecteurMode.setForceSelection(true) ;
-
 
118
		selecteurMode.setValue("toutes les observations") ;
-
 
119
		selecteurMode.setEditable(false) ;
-
 
120
		selecteurMode.setCls("x-selec-liaison") ;
-
 
121
		
-
 
122
		bt = new Toolbar() ;
-
 
123
		bt.addField(selecteurMode) ;
-
 
124
		
-
 
125
		setTopToolbar(bt) ;
-
 
126
		
-
 
127
		selecteurMode.addListener(new ComboBoxListenerAdapter() {
-
 
128
 
-
 
129
			public void onSelect(ComboBox comboBox, Record record, int index) {
-
 
130
				
-
 
131
				// et on met la valeur à jour dans la combobox
-
 
132
				comboBox.setValue(record.getAsString("nom_mode"));
-
 
133
				setModification(record.getAsString("mode")) ;
-
 
134
			}
-
 
135
 
-
 
136
		});
87
		
137
		
88
		setAutoScroll(true) ;
138
		setAutoScroll(true) ;
89
		// on configure le drag 'n drop
139
		// on configure le drag 'n drop
Line 90... Line 140...
90
		configDragAndDrop() ;
140
		configDragAndDrop() ;
Line 205... Line 255...
205
				}) ;
255
				}) ;
206
			}
256
			}
Line 207... Line 257...
207
	
257
	
Line -... Line 258...
-
 
258
		}
-
 
259
		
208
		}
260
		deMasquerChargement() ;
Line 209... Line 261...
209
		
261
		
210
	}
262
	}
211
	
263
	
Line 227... Line 279...
227
	public Store getStore()
279
	public Store getStore()
228
	{
280
	{
229
		return store ;
281
		return store ;
230
	}
282
	}
Line -... Line 283...
-
 
283
	
-
 
284
	/*public BarrePaginationVue getBarrePagination()
-
 
285
	{
-
 
286
		return pgBar ;
-
 
287
	}*/
-
 
288
	
-
 
289
	private void setModification(String mode)
-
 
290
	{
-
 
291
		if(mode.equals("true")) {
-
 
292
 
-
 
293
			liaison = true ;
-
 
294
			selecteurMode.removeClass("x-selec-consult") ;
-
 
295
			selecteurMode.setCls("x-selec-liaison") ;
-
 
296
		}
-
 
297
		else
-
 
298
		{
-
 
299
			liaison = false ;
-
 
300
			selecteurMode.removeClass("x-selec-liaison") ;
-
 
301
			selecteurMode.setCls("x-selec-consult") ;
-
 
302
			
-
 
303
		}
-
 
304
		
-
 
305
		masquerChargement() ;
-
 
306
		store.removeAll() ;
-
 
307
		iMediateur.changerModeLiaison(liaison) ;
-
 
308
		
-
 
309
	}
-
 
310
	
-
 
311
	public boolean getMode() {
-
 
312
		return liaison ;
-
 
313
	}
-
 
314
	
-
 
315
	/**
-
 
316
	 * Recherche l'élement actuellement affiché et affiche son message de chargement
-
 
317
	 */
-
 
318
	public void masquerChargement()
-
 
319
	{
-
 
320
			ExtElement masked = Ext.get(getId()) ;
-
 
321
 
-
 
322
			if (masked!=null) {
-
 
323
				masked.mask("Chargement") ;
-
 
324
			}
-
 
325
	}
-
 
326
	
-
 
327
	/**
-
 
328
	 * Recherche l'élement actuellement affiché et affiche son message de chargement
-
 
329
	 */
-
 
330
	public void deMasquerChargement()
-
 
331
	{
-
 
332
			ExtElement masked = Ext.get(getId()) ;
-
 
333
 
-
 
334
			if (masked!=null) {
-
 
335
				masked.unmask() ;
-
 
336
			}
-
 
337
	}
Line 231... Line 338...
231
	
338