Subversion Repositories eFlore/Applications.coel

Rev

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