Subversion Repositories eFlore/Applications.coel

Rev

Rev 499 | Rev 1415 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
package org.tela_botanica.client.modeles;
2
 
3
import java.io.Serializable;
4
 
5
import com.extjs.gxt.ui.client.data.BaseTreeModel;
6
 
499 jp_milcent 7
public class Menu extends BaseTreeModel implements Serializable {
60 jpm 8
 
64 jpm 9
	/**
10
	 * Identifiant pour sérialisé l'objet...
11
	 */
12
	private static final long serialVersionUID = 4;
13
 
60 jpm 14
	public Menu() {
15
	}
16
 
312 jp_milcent 17
	public Menu(String nom) {
18
		set("nom", nom);
60 jpm 19
	}
312 jp_milcent 20
	public Menu(String nom, String code) {
21
		set("nom", nom);
22
		set("code", code);
23
	}
60 jpm 24
 
25
	public Menu(String nom, BaseTreeModel[] enfant) {
26
		this(nom);
27
		for (int i = 0; i < enfant.length; i++) {
28
			add(enfant[i]);
29
		}
30
	}
31
 
32
	public String getNom() {
312 jp_milcent 33
		return get("nom");
60 jpm 34
	}
324 jp_milcent 35
	public void setNom(String nom) {
36
		set("nom", nom);
37
	}
312 jp_milcent 38
 
39
	public String getCode() {
40
		return get("code");
41
	}
324 jp_milcent 42
	public void setCode(String code) {
43
		set("code", code);
44
	}
60 jpm 45
 
46
	public String toString() {
324 jp_milcent 47
		return getNom()+" - Nbre enfant :"+this.getChildCount();
60 jpm 48
	}
49
 
50
}