Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 857 Rev 861
Line 51... Line 51...
51
	ComboBox<Valeur> types = null;
51
	ComboBox<Valeur> types = null;
Line 52... Line 52...
52
	
52
	
53
	int largeurTotale = 420;
53
	int largeurTotale = 420;
54
	int largeurBouton = 20;
54
	int largeurBouton = 20;
-
 
55
	int largeurChamp = 0;
Line 55... Line 56...
55
	int largeurChamp = 0;
56
	int largeurType = 0;
56
 	
57
 	
Line 57... Line 58...
57
	boolean estMultiType = false;
58
	boolean estMultiType = false;
Line 71... Line 72...
71
	
72
	
72
	public ChampMultiValeurs(boolean estMultiType, String label, int largeurTotale) {
73
	public ChampMultiValeurs(boolean estMultiType, String label, int largeurTotale) {
73
		this.estMultiType = estMultiType;
74
		this.estMultiType = estMultiType;
74
		initialiserChampMultiValeur(label, largeurTotale);
75
		initialiserChampMultiValeur(label, largeurTotale);
75
	}
76
	}
76
	
77
		
77
	public ChampMultiValeurs(boolean estCombobox, boolean estMultiType, String label, int largeurTotale) {
78
	public ChampMultiValeurs(boolean estCombobox, boolean estMultiType, String label, int largeurTotale, int largeurType) {
78
		this.estMultiType = estMultiType;
79
		this.estMultiType = estMultiType;
-
 
80
		this.estComboBox = estCombobox;
79
		this.estComboBox = estCombobox;
81
		setLargeurType(largeurType);
80
		initialiserChampMultiValeur(label, largeurTotale);
82
		initialiserChampMultiValeur(label, largeurTotale);
Line 81... Line 83...
81
	}
83
	}
82
	
84
	
83
	public void setLabel(String label) {
85
	public void setLabel(String label) {
84
		if (label == null) {
86
		if (label == null) {
85
			label = "";
87
			label = "";
86
		}
88
		}
Line 87... Line 89...
87
		nomLabelChampTxt = label;
89
		nomLabelChampTxt = label;
88
	}
90
	}
89
	
91
	
90
	public void setLargeur(int largeur) {
92
	public void setLargeurChamp(int largeurMax) {
-
 
93
		if (largeurMax != 0 && largeurMax > 20) {
91
		if (largeur != 0 && largeur > 20) {
94
			largeurTotale = largeurMax;
92
			largeurTotale = largeur;
95
		}
Line -... Line 96...
-
 
96
		
-
 
97
		largeurChamp = largeurTotale - largeurBouton;
-
 
98
	}
-
 
99
	
93
		}
100
	public void setLargeurType(int largeur) {
94
		largeurChamp = largeurTotale - largeurBouton;
101
		largeurType = largeur;
95
	}
102
	}
Line 96... Line 103...
96
	
103
		
Line 110... Line 117...
110
		this.boutonSupprimerLabel = valeur;
117
		this.boutonSupprimerLabel = valeur;
111
	}
118
	}
Line 112... Line 119...
112
	
119
	
113
	private void initialiserChampMultiValeur(String label, int largeur) {
120
	private void initialiserChampMultiValeur(String label, int largeur) {
114
		setLabel(label);
121
		setLabel(label);
Line 115... Line 122...
115
		setLargeur(largeur);
122
		setLargeurChamp(largeur);
116
		
123
		
117
		titreErreur = Mediateur.i18nC.erreurSaisieTitre();
124
		titreErreur = Mediateur.i18nC.erreurSaisieTitre();
Line 130... Line 137...
130
	private void creerChampMultiValeurs() {
137
	private void creerChampMultiValeurs() {
131
		principalLayout = new LayoutContainer();
138
		principalLayout = new LayoutContainer();
132
		principalLayout.setLayout(new RowLayout());
139
		principalLayout.setLayout(new RowLayout());
Line 133... Line 140...
133
		
140
		
134
		LabelField label = new LabelField(nomLabelChampTxt + ":");
141
		LabelField label = new LabelField(nomLabelChampTxt + ":");
135
		label.setWidth(largeurChamp);
142
		label.setWidth("95%");
Line 136... Line 143...
136
		principalLayout.add(label);
143
		principalLayout.add(label);
137
		
144
		
Line 138... Line 145...
138
		LayoutContainer colonneLayout = new LayoutContainer();
145
		LayoutContainer colonneConteneur = new LayoutContainer();
139
		colonneLayout.setLayout(new ColumnLayout());
-
 
140
		
146
		colonneConteneur.setLayout(new ColumnLayout());
141
		if (estMultiType == true)	{
147
		
142
			largeurChamp = largeurChamp - 150;
148
		if (estMultiType == true)	{
143
			types = new ComboBox<Valeur>();
149
			types = new ComboBox<Valeur>();
144
			types.setDisplayField("nom");
150
			types.setDisplayField("nom");
145
			types.setEmptyText("Choisissez:");			
151
			types.setEmptyText("Choisissez:");			
Line 146... Line 152...
146
			types.setStore(new ListStore<Valeur>());
152
			types.setStore(new ListStore<Valeur>());
147
			colonneLayout.add(types, new ColumnData(150));
153
			colonneConteneur.add(types, new ColumnData(largeurType));
148
		}
154
		}
149
		
155
		
150
		if (estComboBox) {
156
		if (estComboBox) {
151
			champValeurCombo = new ComboBox<Valeur>();
157
			champValeurCombo = new ComboBox<Valeur>();
152
			champValeurCombo.setDisplayField("nom");
158
			champValeurCombo.setDisplayField("nom");
153
			champValeurCombo.setStore(new ListStore<Valeur>());
159
			champValeurCombo.setStore(new ListStore<Valeur>());
154
			colonneLayout.add(champValeurCombo, new ColumnData(largeurChamp));
160
			colonneConteneur.add(champValeurCombo, new ColumnData(largeurChamp));
155
		} else {
161
		} else {
156
			champValeurTxt = new TextField<String>();
162
			champValeurTxt = new TextField<String>();
157
			colonneLayout.add(champValeurTxt, new ColumnData(largeurChamp));
163
			colonneConteneur.add(champValeurTxt, new ColumnData(largeurChamp));
158
		}
164
		}
Line 198... Line 204...
198
						}
204
						}
199
					}
205
					}
200
				}
206
				}
201
			}
207
			}
202
		});
208
		});
203
		colonneLayout.add(ajouterBouton, new ColumnData(largeurBouton));
209
		colonneConteneur.add(ajouterBouton, new ColumnData(largeurBouton));
Line 204... Line 210...
204
		
210
		
205
		principalLayout.add(champRecapitulatif);
211
		principalLayout.add(champRecapitulatif);
206
		principalLayout.add(colonneLayout);
212
		principalLayout.add(colonneConteneur);
207
		add(principalLayout);
213
		add(principalLayout);
Line 208... Line 214...
208
	}
214
	}
209
	
215