📄 menumodel.java
字号:
/*
* Created on 2004-8-22
*
*/
package com.esimple.framework.web.taglib.menu;
import java.util.ArrayList;
/**
* @author steven
*
*/
public class MenuModel {
private String id;
private String icon;
private String label;
private String action;
private String target;
private String tips;
private boolean leaf;
private boolean root;
private ArrayList childen;
public MenuModel() {
childen = new ArrayList();
root = true;
}
public MenuModel(String icon, String label, String action, String target,String tips) {
this.label = label;
this.action = action;
this.target = target;
this.tips = tips;
this.icon = icon;
this.childen = new ArrayList();
root = false;
leaf = true;
}
public MenuModel(String label, String action, String target) {
this.label = label;
this.action = action;
this.target = target;
this.childen = new ArrayList();
root = false;
leaf = true;
}
public MenuModel(String label,String tips) {
this.label = label;
this.tips = tips;
this.childen = new ArrayList();
root = false;
leaf = true;
}
public MenuModel(String label) {
this.label = label;
this.childen = new ArrayList();
root = false;
leaf = true;
}
public MenuModel getChild(int index) {
if (leaf)
return null;
if (childen == null)
return null;
return (MenuModel) childen.get(index);
}
public void addChild(MenuModel model) {
if (childen != null) {
childen.add(model);
}
leaf = false;
}
public void removeChild(int index) {
if (childen != null) {
childen.remove(index);
}
if( childen.size() == 0 ) leaf = true;
}
/**
* @return
*/
public String getId() {
return id;
}
/**
* @param string
*/
public void setId(String id) {
this.id = id;
}
/**
* @return
*/
public String getTips() {
return tips;
}
/**
* @param string
*/
public void setTips(String tips) {
this.tips = tips;
}
/**
* @return
*/
public String getLabel() {
return label;
}
/**
* @param string
*/
public void setLabel(String string) {
label = string;
}
public boolean isRoot() {
return this.root;
}
public void setRoot(boolean root) {
this.root = root;
}
public boolean isLeaf() {
return this.leaf;
}
public void setLeaf(boolean leaf) {
this.leaf = leaf;
}
/**
* @return
*/
public String getTarget() {
return target;
}
/**
* @param string
*/
public void setTarget(String string) {
target = string;
}
/**
* @return
*/
public String getAction() {
return action;
}
/**
* @param string
*/
public void setAction(String action) {
this.action = action;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getIcon() {
return this.icon;
}
public ArrayList getChilden() {
return childen;
}
public void setChilden(ArrayList list) {
childen = list;
}
public int getChildenSize() {
if( childen == null ) return 0;
return childen.size();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -