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

📄 contacttreenode.java

📁 国外的一套开源CRM
💻 JAVA
字号:
/*
 * 
 * Copyright (c) 2004 SourceTap - www.sourcetap.com
 *
 *  The contents of this file are subject to the SourceTap Public License 
 * ("License"); You may not use this file except in compliance with the 
 * License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
 * Software distributed under the License is distributed on an  "AS IS"  basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 */

package com.sourcetap.sfa.ui;

import org.ofbiz.entity.*;

import java.util.*;


/**
 * DOCUMENT ME!
 *
 */
public class ContactTreeNode extends BasicTreeNode {
    public ContactTreeNode() {
        super();
    }

    public ContactTreeNode(Object userObject) {
        super(userObject);
    }

    /**
     * DOCUMENT ME!
     *
     * @param delegator 
     * @param accountId 
     *
     * @return 
     *
     * @throws GenericEntityException 
     * @throws ClassNotFoundException 
     * @throws LinkageError 
     * @throws ExceptionInInitializerError 
     * @throws InstantiationException 
     * @throws IllegalAccessException 
     */
    public static BasicTreeNode createTree(GenericDelegator delegator,
        String accountId)
        throws GenericEntityException, ClassNotFoundException, LinkageError, 
            ExceptionInInitializerError, InstantiationException, 
            IllegalAccessException {
        ArrayList orderBy = new ArrayList();
        orderBy.add("reportsTo");

        HashMap acctMap = new HashMap();
        acctMap.put("accountId", accountId);

        List rows = delegator.findByLike("Contact", acctMap, orderBy);
        GenericValue[] genericValue = (GenericValue[]) rows.toArray(new GenericValue[0]);

        return createTree(genericValue, "contactId", "reportsTo",
            "com.sourcetap.sfa.ui.ContactTreeNode");
    }

    /**
     * DOCUMENT ME!
     *
     * @return 
     */
    public String getDisplayText() {
        Object o = getUserObject();

        String name = "";
        String title = "";

        if (o instanceof String) {
            name = (String) o;

            if (name.equals("PLACEHOLDER")) {
                name = "";
            }
        } else if (o instanceof GenericValue) {
            GenericValue gv = (GenericValue) o;
            name = (String) gv.get("firstName") + " " + gv.get("lastName");
            title = (String) gv.get("title");
        }

        String html = "<font color=#003399><b><center>" + name +
            "</center></b>\n";
        html += ("<br><center>" + title + "\n");

        //		html += "<br><div align=right><a href=\"viewdeptinfo.php?deptid=$deptid1\"><img src=\"./info.gif\" alt=\"View Department Information\" width=\"17\" height=\"17\" border=0></a></div>\n";
        return html;
    }
}

⌨️ 快捷键说明

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