⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 richfacestreenodebean.java

📁 一个自娱自乐的demo 开发环境 apache-tomcat-6.0.16 Mysql 5.1.11 Jdk 1.6 文件结构如下 --MyGame -----MyGam
💻 JAVA
字号:
package com.hb.base.view.domain;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;

import org.richfaces.model.TreeNode;

/**
 * 2008/01/24
 * 
 * @author 何 貝
 * 
 */
public class RichFacesTreeNodeBean implements TreeNode {
	/***/
	private static final long serialVersionUID = 2755754613221738481L;
	/** 节点 ID */
	private String nodeID;
	/** 节点内容 */
	private String nodeTxt;
	/** Menu Node Action Path */
	private String actionPath;
	/** 有效开始时间 */
	private String startDate;
	/** 有效结束时间 */
	private String endDate;
	/** 节点类型 */
	private String type;
	/** 父节点 */
	private TreeNode parent;
	/** 子节点Map */
	private Map<Object, TreeNode> childrenMap = new LinkedHashMap<Object, TreeNode>();

	public RichFacesTreeNodeBean() {

	}

	public RichFacesTreeNodeBean(String nodeID, String nodeTxt, String nodeType) {
		this.nodeID = nodeID;
		this.nodeTxt = nodeTxt;
		this.type = nodeType;
	}

	public RichFacesTreeNodeBean(String nodeID, String nodeTxt, String nodeType,
			String actionPath) {
		this.nodeID = nodeID;
		this.nodeTxt = nodeTxt;
		this.type = nodeType;
		this.actionPath = actionPath;
	}

	public void addChild(Object identifier, TreeNode child) {
		child.setParent(this);
		childrenMap.put(identifier, child);
	}

	public TreeNode getChild(Object identifier) {
		return (TreeNode) childrenMap.get(identifier);
	}

	public Iterator<Entry<Object, TreeNode>> getChildren() {
		return childrenMap.entrySet().iterator();
	}

	public Object getData() {

		return this;
	}

	public TreeNode getParent() {
		return parent;
	}

	public boolean isLeaf() {
		return childrenMap.isEmpty();
	}

	public void removeChild(Object identifier) {
		TreeNode treeNode = (TreeNode) childrenMap.remove(identifier);
		if (treeNode != null) {
			treeNode.setParent(null);
		}
	}

	public void setData(Object data) {

	}

	public void setParent(TreeNode parent) {
		this.parent = (TreeNode) parent;
	}

	public String getNodeID() {
		return nodeID;
	}

	public void setNodeID(String nodeID) {
		this.nodeID = nodeID;
	}

	public String getNodeTxt() {
		return nodeTxt;
	}

	public void setNodeTxt(String nodeTxt) {
		this.nodeTxt = nodeTxt;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getActionPath() {
		return actionPath;
	}

	public void setActionPath(String actionPath) {
		this.actionPath = actionPath;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -