Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 638 Rev 1292
Line 4... Line 4...
4
import org.tela_botanica.client.interfaces.ListePaginable;
4
import org.tela_botanica.client.interfaces.ListePaginable;
5
import org.tela_botanica.client.interfaces.Rafraichissable;
5
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.interfaces.VueListable;
6
import org.tela_botanica.client.interfaces.VueListable;
7
import org.tela_botanica.client.vues.BarrePaginationVue;
7
import org.tela_botanica.client.vues.BarrePaginationVue;
Line 8... Line -...
8
 
-
 
9
import com.google.gwt.core.client.GWT;
8
 
10
import com.google.gwt.user.client.Element;
-
 
11
import com.google.gwt.user.client.Window;
9
import com.google.gwt.user.client.Element;
12
import com.google.gwt.user.client.ui.HTML;
10
import com.google.gwt.user.client.ui.HTML;
13
import com.gwtext.client.core.EventCallback;
11
import com.gwtext.client.core.EventCallback;
14
import com.gwtext.client.core.EventObject;
12
import com.gwtext.client.core.EventObject;
15
import com.gwtext.client.core.Ext;
13
import com.gwtext.client.core.Ext;
Line 28... Line 26...
28
import com.gwtext.client.util.Format;
26
import com.gwtext.client.util.Format;
29
import com.gwtext.client.widgets.Component;
27
import com.gwtext.client.widgets.Component;
30
import com.gwtext.client.widgets.Container;
28
import com.gwtext.client.widgets.Container;
31
import com.gwtext.client.widgets.DataView;
29
import com.gwtext.client.widgets.DataView;
32
import com.gwtext.client.widgets.Panel;
30
import com.gwtext.client.widgets.Panel;
33
import com.gwtext.client.widgets.event.ContainerListener;
-
 
34
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
31
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
35
import com.gwtext.client.widgets.event.DataViewListener;
-
 
36
import com.gwtext.client.widgets.event.DataViewListenerAdapter;
32
import com.gwtext.client.widgets.event.DataViewListenerAdapter;
37
import com.gwtext.client.widgets.event.PanelListenerAdapter;
33
import com.gwtext.client.widgets.event.PanelListenerAdapter;
38
import com.gwtext.client.widgets.grid.GridDragData;
34
import com.gwtext.client.widgets.grid.GridDragData;
Line 39... Line 35...
39
 
35
 
Line 99... Line 95...
99
		// on ajoute des listeners au composant tout entier
95
		// on ajoute des listeners au composant tout entier
100
		this.addListener(new ContainerListenerAdapter() {
96
		this.addListener(new ContainerListenerAdapter() {
Line 101... Line 97...
101
 
97
 
102
			// pour gagner du temps on n'instancie la vue en elle même que lors
98
			// pour gagner du temps on n'instancie la vue en elle même que lors
-
 
99
			// du premier affichage (lazy rendering)
103
			// du premier affichage (lazy rendering)
100
			@Override
Line 104... Line 101...
104
			public void onShow(Component component) {
101
			public void onShow(Component component) {
105
 
102
 
106
				if (!estInstancie) {
103
				if (!estInstancie) {
Line 131... Line 128...
131
		
128
		
Line 132... Line 129...
132
		dView.addListener(new DataViewListenerAdapter() {
129
		dView.addListener(new DataViewListenerAdapter() {
Line -... Line 130...
-
 
130
 
133
 
131
			// gestion du clic sur une image
134
			// gestion du clic sur une image
132
 
Line 135... Line 133...
135
 
133
			@Override
136
			public void onClick(DataView source, int index, Element node,
134
			public void onClick(DataView source, int index, Element node,
Line 137... Line 135...
137
					EventObject e) {
135
					EventObject e) {
Line 138... Line 136...
138
				
136
				
Line -... Line 137...
-
 
137
				// on en notifie le médiateur
139
				// on en notifie le médiateur
138
				getIMediateur().clicGalerieImage(index, node, e);
140
				getIMediateur().clicGalerieImage(index, node, e);
139
 
Line 141... Line 140...
141
 
140
			}
142
			}
141
 
Line 153... Line 152...
153
 
152
 
Line 154... Line 153...
154
			}
153
			}
Line -... Line 154...
-
 
154
 
155
 
155
			// gestion du double clic
156
			// gestion du double clic
156
 
Line 157... Line 157...
157
 
157
			@Override
158
			public void onDblClick(DataView source, int index, Element node,
158
			public void onDblClick(DataView source, int index, Element node,
Line 159... Line 159...
159
					EventObject e) {
159
					EventObject e) {
Line 160... Line 160...
160
 
160
 
Line -... Line 161...
-
 
161
				// on notife le mediateur
161
				// on notife le mediateur
162
				getIMediateur().clicGalerieImage(index, node, e);
Line 162... Line 163...
162
				getIMediateur().clicGalerieImage(index, node, e);
163
 
163
 
164
			}
164
			}
165
 
Line 195... Line 196...
195
	 * Renvoie les ids des images sélectionnées
196
	 * Renvoie les ids des images sélectionnées
196
	 * 
197
	 * 
197
	 * @return un tableau de String contenant les identifiants des images
198
	 * @return un tableau de String contenant les identifiants des images
198
	 *         sélectionnées
199
	 *         sélectionnées
199
	 */
200
	 */
-
 
201
	@Override
200
	public String[] getIdSelectionnees() {
202
	public String[] getIdSelectionnees() {
201
		Record[] selection = getDView().getSelectedRecords();
203
		Record[] selection = getDView().getSelectedRecords();
202
		int taille = selection.length;
204
		int taille = selection.length;
203
		String id_selection[] = new String[taille];
205
		String id_selection[] = new String[taille];
Line 259... Line 261...
259
 
261
 
260
		// la dataview affichera les images en accord avec le template
262
		// la dataview affichera les images en accord avec le template
261
		// cree precedemment
263
		// cree precedemment
Line -... Line 264...
-
 
264
		dView = new DataView("div.thumb-wrap") {
262
		dView = new DataView("div.thumb-wrap") {
265
 
263
 
266
			@Override
264
			public void prepareData(Data data) {
267
			public void prepareData(Data data) {
Line 265... Line 268...
265
				data.setProperty("shortName", Format.ellipsis(data
268
				data.setProperty("shortName", Format.ellipsis(data
Line 359... Line 362...
359
 
362
 
360
		//La drop target permet de gérer l'évenement onDrop sur l'élement courant
363
		//La drop target permet de gérer l'évenement onDrop sur l'élement courant
361
		@SuppressWarnings("unused")
364
		@SuppressWarnings("unused")
362
		DropTarget tg = new DropTarget(this, dtc)
365
		DropTarget tg = new DropTarget(this, dtc)
-
 
366
		{
363
		{
367
			@Override
Line 364... Line 368...
364
			public boolean notifyDrop(DragSource source, EventObject e, DragData data){		
368
			public boolean notifyDrop(DragSource source, EventObject e, DragData data){		
365
				
369
				
366
				// si les données proviennent d'une grille
370
				// si les données proviennent d'une grille
Line 370... Line 374...
370
		    		  	return iMediateur.lierObsDD(source, e, data,getId()) ;   
374
		    		  	return iMediateur.lierObsDD(source, e, data,getId()) ;   
371
		    	}
375
		    	}
372
				return false ;
376
				return false ;
373
			}
377
			}
Line -... Line 378...
-
 
378
			
374
			
379
			@Override
375
			public String notifyOver(DragSource source, EventObject e, DragData data){
380
			public String notifyOver(DragSource source, EventObject e, DragData data){
376
			    return "x-dd-drop-ok";
381
			    return "x-dd-drop-ok";
377
			}
382
			}
Line 378... Line 383...
378
		};
383
		};
Line 379... Line 384...
379
        
384
        
380
	}
385
	}
381
 
386
 
-
 
387
	/**
382
	/**
388
	 * Méthode héritée de l'interface rafraichissable
383
	 * Méthode héritée de l'interface rafraichissable
389
	 */
Line 384... Line 390...
384
	 */
390
	@Override
385
	public void rafraichir(Object nouvelleDonnees,
391
	public void rafraichir(Object nouvelleDonnees,
Line 447... Line 453...
447
 
453
 
Line 448... Line 454...
448
		getDView().select(ids);
454
		getDView().select(ids);
Line -... Line 455...
-
 
455
 
449
 
456
	}
Line 450... Line 457...
450
	}
457
 
Line 451... Line 458...
451
 
458
	@Override
Line -... Line 459...
-
 
459
	public void changerNumeroPage(int pageCourante) {
452
	public void changerNumeroPage(int pageCourante) {
460
		
Line 453... Line 461...
453
		
461
		iMediateur.changerNumeroPage(pageCourante) ;
454
		iMediateur.changerNumeroPage(pageCourante) ;
462
		
Line 484... Line 492...
484
	
492
	
Line 485... Line 493...
485
	private void AjouterListenersLiens() {
493
	private void AjouterListenersLiens() {
Line -... Line 494...
-
 
494
 
486
 
495
		addListener(new PanelListenerAdapter() {
487
		addListener(new PanelListenerAdapter() {
496
			
488
			
497
			@Override
489
			public void onAfterLayout(Container c) {
498
			public void onAfterLayout(Container c) {
-
 
499
				ExtElement uploadS = Ext.get("lienUploadSimple");
490
				ExtElement uploadS = Ext.get("lienUploadSimple");
500
				uploadS.removeAllListeners();
491
				uploadS.removeAllListeners();
501
				uploadS.addListener("click", new EventCallback() {
492
				uploadS.addListener("click", new EventCallback() {
502
					@Override
Line 493... Line 503...
493
					public void execute(EventObject e) {
503
					public void execute(EventObject e) {
Line 494... Line 504...
494
						getIMediateur().uploaderImages(false);
504
						getIMediateur().uploaderImages(false);
495
					}
505
					}
496
					
506
					
-
 
507
				}) ;
497
				}) ;
508
			
498
			
509
				ExtElement uploadM = Ext.get("lienUploadMultiple");
499
				ExtElement uploadM = Ext.get("lienUploadMultiple");
510
				uploadM.removeAllListeners();
500
				uploadM.removeAllListeners();
511
				uploadM.addListener("click", new EventCallback() {
501
				uploadM.addListener("click", new EventCallback() {
512
					@Override