Subversion Repositories eFlore/Archives.cel-v2

Rev

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

Rev 5 Rev 6
Line 4... Line 4...
4
 
4
 
5
import org.tela_botanica.client.image.ImageMediateur;
5
import org.tela_botanica.client.image.ImageMediateur;
Line -... Line 6...
-
 
6
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
7
 
7
 
8
 
8
 
9
import com.google.gwt.user.client.Window;
9
import com.gwtext.client.data.ArrayReader;
10
import com.gwtext.client.data.ArrayReader;
10
import com.gwtext.client.data.FieldDef;
11
import com.gwtext.client.data.FieldDef;
11
import com.gwtext.client.data.MemoryProxy;
12
import com.gwtext.client.data.MemoryProxy;
12
import com.gwtext.client.data.Record;
13
import com.gwtext.client.data.Record;
13
import com.gwtext.client.data.RecordDef;
14
import com.gwtext.client.data.RecordDef;
14
import com.gwtext.client.data.Store;
15
import com.gwtext.client.data.Store;
-
 
16
import com.gwtext.client.data.StoreMgr;
15
import com.gwtext.client.data.StoreMgr;
17
import com.gwtext.client.data.StringFieldDef;
16
import com.gwtext.client.data.StringFieldDef;
18
import com.gwtext.client.widgets.Component;
17
import com.gwtext.client.widgets.Component;
19
import com.gwtext.client.widgets.event.ContainerListener;
18
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
20
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
19
import com.gwtext.client.widgets.event.PanelListener;
21
import com.gwtext.client.widgets.event.PanelListener;
20
import com.gwtext.client.widgets.event.PanelListenerAdapter;
22
import com.gwtext.client.widgets.event.PanelListenerAdapter;
21
import com.gwtext.client.widgets.grid.CellMetadata;
23
import com.gwtext.client.widgets.grid.CellMetadata;
-
 
24
import com.gwtext.client.widgets.grid.ColumnConfig;
22
import com.gwtext.client.widgets.grid.ColumnConfig;
25
import com.gwtext.client.widgets.grid.ColumnModel;
23
import com.gwtext.client.widgets.grid.ColumnModel;
26
import com.gwtext.client.widgets.grid.GridPanel;
Line 24... Line 27...
24
import com.gwtext.client.widgets.grid.GridPanel;
27
import com.gwtext.client.widgets.grid.GridView;
Line 58... Line 61...
58
 
61
 
59
			public String render(Object value, CellMetadata cellMetadata,
62
			public String render(Object value, CellMetadata cellMetadata,
Line 60... Line 63...
60
					Record record, int rowIndex, int colNum, Store store) {
63
					Record record, int rowIndex, int colNum, Store store) {
61
 
64
 
62
				String ImgUrl = record.getAsString("url_image");
65
				String ImgUrl = record.getAsString("url_image");
Line 63... Line 66...
63
				return "<img src=\""+ImgUrl+"\" title='example'>";
66
				return "<div class=\"img-list\"> <img src=\""+ImgUrl+"\" title='example'> </div>";
Line 64... Line 67...
64
			}
67
			}
65
 
68
 
66
		});
69
		});
-
 
70
		
Line 67... Line 71...
67
		
71
		ColumnConfig[] cm = {numImage,urlImage};
68
		ColumnConfig[] cm = {numImage,urlImage};
72
		modeleColonnes = new ColumnModel(cm);
69
		modeleColonnes = new ColumnModel(cm);
73
		this.setColumnModel(modeleColonnes);
70
		this.setColumnModel(modeleColonnes);
74
		this.setAutoScroll(true);
71
		
75
		
72
		
76
		
Line 73... Line 77...
73
		FieldDef defNumImage = new StringFieldDef("num_image");
77
		FieldDef defNumImage = new StringFieldDef("num_image");
-
 
78
		FieldDef defUrlImage = new StringFieldDef("url_image");
74
		FieldDef defUrlImage = new StringFieldDef("url_image");
79
		FieldDef[] defTab = {defNumImage,defUrlImage};
Line 75... Line 80...
75
		FieldDef[] defTab = {defNumImage,defUrlImage};
80
		RecordDef rd = new RecordDef(defTab) ;
76
		RecordDef rd = new RecordDef(defTab) ;
81
		st = new Store(rd) ;
Line 77... Line 82...
77
		st = new Store(rd) ;
82
		this.setStore(st);
Line 78... Line 83...
78
		this.setStore(st);
83
		
Line 79... Line 84...
79
		
84
		ajouterListeners() ;
80
		ajouterListeners() ;
85
		
81
	}
86
	}
Line -... Line 87...
-
 
87
	
-
 
88
	
-
 
89
	// role : configurer les colonnes affichées dans la grille
-
 
90
	private void initialiser() {
-
 
91
		
-
 
92
		getIMediateur().obtenirPhotoGalerie(this);
82
	
93
		
83
	
94
		
Line 84... Line 95...
84
	// role : configurer les colonnes affichées dans la grille
95
	}
Line 106... Line 117...
106
			}
117
			}
Line 107... Line 118...
107
 
118
 
Line 108... Line -...
108
 
-
 
109
			public void onShow(Component component) {
-
 
110
				
119
 
Line 111... Line 120...
111
				
120
			public void onShow(Component component) {
112
					initialiser();
121
				
Line 113... Line 122...
113
			}
122
			}
114
			
-
 
Line 115... Line 123...
115
		});
123
			
-
 
124
		});
116
	}
125
	}
117
 
126
 
118
 
127
 
119
	public void rafraichir(Object nouvelleDonnees) {
128
	public void rafraichir(Object nouvelleDonnees) {
Line 120... Line 129...
120
		// TODO Auto-generated method stub
129
		
121
		
-
 
Line 122... Line 130...
122
		Object[][] photoData = (Object[][])nouvelleDonnees ;
130
		Object[][] photoData = (Object[][])nouvelleDonnees ;
123
		final MemoryProxy dataProxy = new MemoryProxy(photoData);
131
 
-
 
132
		final MemoryProxy dataProxy = new MemoryProxy(photoData);
124
		final ArrayReader reader = new ArrayReader(new RecordDef(
133
		final ArrayReader reader = new ArrayReader(new RecordDef(
Line 125... Line 134...
125
				new FieldDef[]{new StringFieldDef("num_image"),
134
				new FieldDef[]{new StringFieldDef("num_image"),
126
						new StringFieldDef("url_image")}));
135
						new StringFieldDef("url_image")}));