1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| package com.corejsf;
import java.util.ArrayList;
import java.util.List;
public class ListeVoiture
{
private List cars;
private String triColumn = null;
private boolean sortAscending = true;
public ListeVoiture()
{
cars = new ArrayList();
cars.add(new Voiture("Pigeot", "1070", 2004));
cars.add(new Voiture("Pigeot", "2070", 2005));
cars.add(new Voiture("Pigeot", "3070", 2002));
cars.add(new Voiture("Reno", "Cinic", 2001));
cars.add(new Voiture("Reno", "Migone", 2003));
cars.add(new Voiture("Reno", "Cloé IV", 2006));
}
public List getCars()
{
return cars;
}
public void setCars(List cars)
{
this.cars = cars;
}
public String getTriColumn()
{
return triColumn;
}
public void setTriColumn(String triColumn)
{
this.triColumn = triColumn;
}
public boolean isSortAscending()
{
return sortAscending;
}
public void setSortAscending(boolean sortAscending)
{
this.sortAscending = sortAscending;
}
private String tempMarqueAuto;
private String addVoiture;
public void setAddVoiture(String aModele){
if(aModele!=(null))
this.addVoiture = aModele;
cars.add(new Voiture(tempMarqueAuto, addVoiture, 0));
// System.out.println("********marque après la création du nouvel objet Voiture : " + tempMarqueAuto ) ;
}
public String getAddVoiture()
{
return addVoiture;
}
/* c'est la partie qui nous interesse */
public void setTempMarqueAuto(String aMarque){
if(aMarque!=(null))
this.tempMarqueAuto = aMarque;
// System.out.println("*********marque récupérée : " + tempMarqueAuto ) ;
}
public String getTempMarqueAuto()
{
return addVoiture;
}
} |
Partager