package com.etixpert.evolution.gui.servlets;

import java.util.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.jstl.fmt.LocaleSupport;

import com.etixpert.evolution.*;

public class Menu {
    public final static int ROOT=0;
    public final static int FOLDER=1;
    public final static int LINK=2;
    public final static int TAB=3;
    
	
	protected int id;
	protected String descr;
	protected String dbLink;
	protected int type;
	protected int pos;
	protected Menu parent;
	protected Set children = new HashSet();
	
	public Set getChildren() {
		return children;
	}
	void setChildren(Set children) {
		this.children = children;
	}
	private String getDbLink() {
		return dbLink;
	}
	private void setDbLink(String dbLink) {
		this.dbLink = dbLink;
	}
	private String getDescr() {
		return descr;
	}
	 void setDescr(String descr) {
		this.descr = descr;
	}
	public int getId() {
		return id;
	}
	private void setId(int id) {
		this.id = id;
	}
	public Menu getParent() {
		return parent;
	}
	
	void setParent(Menu parent) {
		this.parent = parent;
	}
	public int getPos() {
		return pos;
	}
	void setPos(int pos) {
		this.pos = pos;
	}
	
	public int getType() {
		return type;
	}
	
	void setType(int type) {
		this.type = type;
	}
	

	public String getLink(HttpSession session) {
		return Tools.parse(session, dbLink);
	}
	
	public String getName(PageContext pc) {
		return LocaleSupport.getLocalizedMessage(pc, descr);
	}
}





















