📄 treenodeobject.java
字号:
package com.socialite.bizlogic.tree;
/*
*
* 定义节点类TreeNodeObject
*
* @author : sheng chunling
* @version : 1.0
* @date: 2004-11-19
*/
public class TreeNodeObject{
private String node_id;//bizlogic服务器传给web程序的参数都是String
private String father_id;
private String name;
private String url;
public TreeNodeObject(String node_id,String father_id,String name,String url){
this.node_id=node_id;
this.father_id=father_id;
this.name=name;
this.url=url;
}
/*
* 获取node_id
*
* @return String
*/
public String getNodeId(){
return node_id;
}
/*
* 获取father_id
*
* @return String
*/
public String getFatherId(){
return father_id;
}
/*
* 获取name
*
* @return String
*/
public String getName(){
return name;
}
/*
* 获取url
*
* @return String
*/
public String getUrl(){
return url;
}
/*
* 设置node_id
*
* @return
*/
public void setNodeId(String node_id){
this.node_id=node_id;
}
/*
* 设置father_id
*
* @return
*/
public void setFatherId(String father_id){
this.father_id=father_id;
}
/*
* 设置name
*
* @return
*/
public void setName(String name){
this.name=name;
}
/*
* 设置url
*
* @return
*/
public void setUrl(String url){
this.url=url;
}
/*
* 判断节点是否为根节点
*
* 这个方法可以不要,java中DefaultMutableTreeNode提供了相应方法
*
* @return boolean
*/
/*
public boolean isRoot(){
if(("0".equalsIgnoreCase(node_id.trim())) && father_id==null){
return true;
}
return false;
}
*/
/**
* toString()方法,返回节点name,以便显示。如果是在java中用Jtree显示树,
* 该方法是必须实现的。用javascript可能不需要,直接访问name属性进行显示
* 应该就可以。这里暂时先实现该方法。
* jdkdoc:(TreeModel) The argument to the DefaultMutableTreeNode
* constructor is the user object — an object that contains or
* points to the data associated with the tree node. The user
* object can be a string, or it can be a custom object. If you
* implement a custom object, you should implement its toString
* method so that it returns the string to be displayed for that node.
**/
public String toString(){
return name;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -