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

📄 htmltreenode.java

📁 这个是使用java开发的一个平台
💻 JAVA
字号:
package com.exp.web.html.xtree;

import java.util.Vector;

/**
 * <p>
 * Title: jstrd 基础技术平台
 * </p>
 * <p>
 * Description: jstrd 基础技术平台
 * </p>
 * <p>
 * Copyright: Copyright (c)  jstrd 2004-2008
 * </p>
 * <p>
 * Company: jstrd
 * </p>
 * 
 * @author zhanghf
 * @version 3.0.0.0
 */

public class HtmlTreeNode {
    protected String name;

    protected String caption;

    protected String icon = "";

    protected String openIcon = "";

    protected Vector children = new Vector();

    protected HtmlTreeNode parent;

    public HtmlTreeNode(String name, String caption) {
        this.name = name;
        this.caption = caption;
    }

    public void setIcon(String iconUrl) {
        this.icon = iconUrl;
    }

    public void setOpenIcon(String iconUrl) {
        this.openIcon = iconUrl;
    }

    public String getIconUrl() {
        return this.icon;
    }

    public String getOpenIcon() {
        return this.openIcon;
    }

    public String getName() {
        return this.name;
    }

    public String getCaption() {
        return this.caption;
    }

    protected void setParent(HtmlTreeNode parent) {
        this.parent = parent;
    }

    /**
     * 增加子节点
     * 
     * @param child
     */
    public void addChild(HtmlTreeNode child) {
        child.setParent(this);
        children.add(child);
    }

    public String toString() {
        StringBuffer scriptCode = new StringBuffer();
        scriptCode.append(this.generateSelfScript());
        if (!"".equals(this.icon)) {
            scriptCode.append(this.name + ".icon=\"" + this.icon + "\";\n");
        }
        if (!"".equals(this.openIcon)) {
            scriptCode.append(this.name + ".openIcon=\"" + this.openIcon
                    + "\";\n");
        }
        int size = children.size();
        for (int i = 0; i < size; i++) {
            scriptCode.append(children.get(i));
        }
        scriptCode.append(this.generatePostScript());
        return scriptCode.toString();
    }

    public int hashCode() {
        return this.name.hashCode();
    }

    public boolean equals(Object parm1) {
        return ((HtmlTreeNode) parm1).getName().equals(this.name);
    }

    protected String generatePostScript() {
        return "";
    }

    protected String generateSelfScript() {
        return "";
    }

}

⌨️ 快捷键说明

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