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
|
public class Cellule extends Composite implements IsSerializable{
private int id;
private String texte;
private Time heure;
private Date date;
public Cellule(){}
public CelluleTest(String texte, Time heure, Date date){
this.texte = texte;
this.heure = heure;
this.date = date;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTexte() {
return texte;
}
public void setTexte(String texte) {
this.texte = texte;
}
public String toString(){
if(texte==null){
return "cellule n°"+id+" = "+"\ncellule vide";
}
return ("cellule n°"+id+" = "+date+"\n"+heure+"\n"+texte);
}
public Time getHeure() {
return heure;
}
public void setHeure(Time heure) {
this.heure = heure;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public void creer(){
VerticalPanel panel = new VerticalPanel();
if(getTexte()==null){
panel.add(new Label("cellule vide"));
}
else{
panel.add(new Label(getDate().toString()));
panel.add(new Label(getHeure().toString()));
panel.add(new Label(getTexte()));
}
initWidget(panel);
setStyleName("cellule");
setSize("100%", "100%");
}
} |
Partager