| Line 162... |
Line 162... |
| 162 |
private Button creerBoutonAjouter() {
|
162 |
private Button creerBoutonAjouter() {
|
| 163 |
Button bouton = new Button(i18nC.ajouter());
|
163 |
Button bouton = new Button(i18nC.ajouter());
|
| 164 |
bouton.setIcon(Images.ICONES.vcardAjouter());
|
164 |
bouton.setIcon(Images.ICONES.vcardAjouter());
|
| 165 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
165 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
| Line 166... |
Line -... |
| 166 |
|
- |
|
| 167 |
@Override
|
166 |
|
| 168 |
public void componentSelected(ButtonEvent ce) {
|
167 |
public void componentSelected(ButtonEvent ce) {
|
| 169 |
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
|
168 |
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
|
| 170 |
fenetreFormulaire.show();
|
169 |
fenetreFormulaire.show();
|
| 171 |
}
|
170 |
}
|
| Line 175... |
Line 174... |
| 175 |
|
174 |
|
| 176 |
private Button creerBoutonModifier() {
|
175 |
private Button creerBoutonModifier() {
|
| 177 |
Button bouton = new Button(i18nC.modifier());
|
176 |
Button bouton = new Button(i18nC.modifier());
|
| 178 |
bouton.setIcon(Images.ICONES.vcardModifier());
|
177 |
bouton.setIcon(Images.ICONES.vcardModifier());
|
| 179 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
- |
|
| 180 |
@Override
|
178 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
| 181 |
public void componentSelected(ButtonEvent ce) {
|
179 |
public void componentSelected(ButtonEvent ce) {
|
| 182 |
CollectionAPersonne personneSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
|
180 |
CollectionAPersonne personneSaisiSelectionne = grille.getSelectionModel().getSelectedItem();
|
| 183 |
if (personneSaisiSelectionne == null) {
|
181 |
if (personneSaisiSelectionne == null) {
|
| 184 |
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
|
182 |
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
|
| Line 220... |
Line 218... |
| 220 |
return formulaire;
|
218 |
return formulaire;
|
| 221 |
}
|
219 |
}
|
| Line 222... |
Line 220... |
| 222 |
|
220 |
|
| 223 |
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePersonne(final FenetreForm fenetre, final PersonneForm formulaire) {
|
221 |
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePersonne(final FenetreForm fenetre, final PersonneForm formulaire) {
|
| 224 |
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
|
- |
|
| 225 |
@Override
|
222 |
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
|
| 226 |
public void componentSelected(ButtonEvent ce) {
|
223 |
public void componentSelected(ButtonEvent ce) {
|
| 227 |
String code = ((Button) ce.getComponent()).getData("code");
|
224 |
String code = ((Button) ce.getComponent()).getData("code");
|
| 228 |
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
|
225 |
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
|
| 229 |
if (formulaire.soumettreFormulaire()) {
|
226 |
if (formulaire.soumettreFormulaire()) {
|
| Line 246... |
Line 243... |
| 246 |
|
243 |
|
| 247 |
private Button creerBoutonSupprimer() {
|
244 |
private Button creerBoutonSupprimer() {
|
| 248 |
Button bouton = new Button(i18nC.supprimer());
|
245 |
Button bouton = new Button(i18nC.supprimer());
|
| 249 |
bouton.setIcon(Images.ICONES.vcardSupprimer());
|
246 |
bouton.setIcon(Images.ICONES.vcardSupprimer());
|
| 250 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
- |
|
| 251 |
@Override
|
247 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
| 252 |
public void componentSelected(ButtonEvent ce) {
|
248 |
public void componentSelected(ButtonEvent ce) {
|
| 253 |
CollectionAPersonne personneSaisiSelectionnee = grille.getSelectionModel().getSelectedItem();
|
249 |
CollectionAPersonne personneSaisiSelectionnee = grille.getSelectionModel().getSelectedItem();
|
| 254 |
if (personneSaisiSelectionnee == null) {
|
250 |
if (personneSaisiSelectionnee == null) {
|
| 255 |
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
|
251 |
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
|
| Line 263... |
Line 259... |
| 263 |
|
259 |
|
| 264 |
private Button creerBoutonRafraichir() {
|
260 |
private Button creerBoutonRafraichir() {
|
| 265 |
Button bouton = new Button(i18nC.rafraichir());
|
261 |
Button bouton = new Button(i18nC.rafraichir());
|
| 266 |
bouton.setIcon(Images.ICONES.rafraichir());
|
262 |
bouton.setIcon(Images.ICONES.rafraichir());
|
| 267 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
- |
|
| 268 |
@Override
|
263 |
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
| 269 |
public void componentSelected(ButtonEvent ce) {
|
264 |
public void componentSelected(ButtonEvent ce) {
|
| 270 |
actualiserGrille();
|
265 |
actualiserGrille();
|
| 271 |
}
|
266 |
}
|
| 272 |
});
|
267 |
});
|
| Line 292... |
Line 287... |
| 292 |
}
|
287 |
}
|
| 293 |
}
|
288 |
}
|
| 294 |
}
|
289 |
}
|
| 295 |
});
|
290 |
});
|
| 296 |
comboBox.addListener(Events.Select, new Listener<BaseEvent>() {
|
291 |
comboBox.addListener(Events.Select, new Listener<BaseEvent>() {
|
| 297 |
@Override
|
- |
|
| 298 |
public void handleEvent(BaseEvent be) {
|
292 |
public void handleEvent(BaseEvent be) {
|
| 299 |
if (personnesSaisisComboBox.getValue() instanceof Personne) {
|
293 |
if (personnesSaisisComboBox.getValue() instanceof Personne) {
|
| 300 |
Personne personneSaisiSelectionnee = personnesSaisisComboBox.getValue();
|
294 |
Personne personneSaisiSelectionnee = personnesSaisisComboBox.getValue();
|
| 301 |
ajouterDansGrille(personneSaisiSelectionnee);
|
295 |
ajouterDansGrille(personneSaisiSelectionnee);
|
| 302 |
personnesSaisisComboBox.setValue(null);
|
296 |
personnesSaisisComboBox.setValue(null);
|
| Line 415... |
Line 409... |
| 415 |
typeRelationCombo.setEditable(false);
|
409 |
typeRelationCombo.setEditable(false);
|
| 416 |
typeRelationCombo.addStyleName(ComposantClass.OBLIGATOIRE);
|
410 |
typeRelationCombo.addStyleName(ComposantClass.OBLIGATOIRE);
|
| 417 |
typeRelationCombo.addListener(Events.Select, Formulaire.creerEcouteurChampObligatoire());
|
411 |
typeRelationCombo.addListener(Events.Select, Formulaire.creerEcouteurChampObligatoire());
|
| Line 418... |
Line 412... |
| 418 |
|
412 |
|
| 419 |
CellEditor editeurRelation = new CellEditor(typeRelationCombo) {
|
- |
|
| 420 |
@Override
|
413 |
CellEditor editeurRelation = new CellEditor(typeRelationCombo) {
|
| 421 |
public Object preProcessValue(Object valeur) {
|
414 |
public Object preProcessValue(Object valeur) {
|
| 422 |
Valeur retour = null;
|
415 |
Valeur retour = null;
|
| 423 |
if (valeur != null ) {
|
416 |
if (valeur != null ) {
|
| 424 |
Debug.log(valeur.toString());
|
417 |
Debug.log(valeur.toString());
|
| Line 431... |
Line 424... |
| 431 |
}
|
424 |
}
|
| 432 |
}
|
425 |
}
|
| 433 |
return retour;
|
426 |
return retour;
|
| 434 |
}
|
427 |
}
|
| Line 435... |
Line -... |
| 435 |
|
- |
|
| 436 |
@Override
|
428 |
|
| 437 |
public Object postProcessValue(Object valeur) {
|
429 |
public Object postProcessValue(Object valeur) {
|
| 438 |
String retour = null;
|
430 |
String retour = null;
|
| 439 |
if (valeur != null ) {
|
431 |
if (valeur != null ) {
|
| 440 |
if (valeur instanceof Valeur) {
|
432 |
if (valeur instanceof Valeur) {
|
| Line 445... |
Line 437... |
| 445 |
return retour;
|
437 |
return retour;
|
| 446 |
}
|
438 |
}
|
| 447 |
};
|
439 |
};
|
| Line 448... |
Line 440... |
| 448 |
|
440 |
|
| 449 |
GridCellRenderer<CollectionAPersonne> relationRendu = new GridCellRenderer<CollectionAPersonne>() {
|
- |
|
| 450 |
@Override
|
441 |
GridCellRenderer<CollectionAPersonne> relationRendu = new GridCellRenderer<CollectionAPersonne>() {
|
| 451 |
public String render(CollectionAPersonne modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<CollectionAPersonne> store, Grid<CollectionAPersonne> grille) {
|
442 |
public String render(CollectionAPersonne modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<CollectionAPersonne> store, Grid<CollectionAPersonne> grille) {
|
| 452 |
// Gestion du texte afficher dans la cellule
|
443 |
// Gestion du texte afficher dans la cellule
|
| 453 |
String role = modele.get("_role_");
|
444 |
String role = modele.get("_role_");
|
| 454 |
if (typeRelationCombo.getStore() != null && role.matches("[0-9]+")) {
|
445 |
if (typeRelationCombo.getStore() != null && role.matches("[0-9]+")) {
|
| Line 466... |
Line 457... |
| 466 |
return typeRelationColonne;
|
457 |
return typeRelationColonne;
|
| 467 |
}
|
458 |
}
|
| Line 468... |
Line 459... |
| 468 |
|
459 |
|
| 469 |
public ColumnConfig creerColonneDeces() {
|
460 |
public ColumnConfig creerColonneDeces() {
|
| 470 |
GridCellRenderer<CollectionAPersonne> decesRendu = new GridCellRenderer<CollectionAPersonne>() {
|
- |
|
| 471 |
@Override
|
461 |
GridCellRenderer<CollectionAPersonne> decesRendu = new GridCellRenderer<CollectionAPersonne>() {
|
| 472 |
public String render(CollectionAPersonne modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<CollectionAPersonne> store, Grid<CollectionAPersonne> grid) {
|
462 |
public String render(CollectionAPersonne modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<CollectionAPersonne> store, Grid<CollectionAPersonne> grid) {
|
| 473 |
String deces = modele.getPersonne().getDeces();
|
463 |
String deces = modele.getPersonne().getDeces();
|
| 474 |
if (listeIon != null && modele.getPersonne().getDeces().matches("[0-9]+")) {
|
464 |
if (listeIon != null && modele.getPersonne().getDeces().matches("[0-9]+")) {
|
| 475 |
deces = listeIon.findModel("id_valeur", modele.getPersonne().getDeces()).getNom();
|
465 |
deces = listeIon.findModel("id_valeur", modele.getPersonne().getDeces()).getNom();
|