001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.util;
016    
017    import java.util.ArrayList;
018    import java.util.List;
019    
020    /**
021     * @author Jorge Ferrer
022     * @author Dennis Ju
023     * @author Brian Wing Shun Chan
024     */
025    public class TreeNodeView {
026    
027            public TreeNodeView(int id) {
028                    _id = id;
029            }
030    
031            public void addChild(TreeNodeView treeNodeView) {
032                    _children.add(treeNodeView);
033            }
034    
035            public List<TreeNodeView> getChildren() {
036                    return _children;
037            }
038    
039            public int getDepth() {
040                    return _depth;
041            }
042    
043            public String getHref() {
044                    return _href;
045            }
046    
047            public long getId() {
048                    return _id;
049            }
050    
051            public String getImg() {
052                    return _img;
053            }
054    
055            public String getLs() {
056                    return _ls;
057            }
058    
059            public String getName() {
060                    return _name;
061            }
062    
063            public String getObjId() {
064                    return _objId;
065            }
066    
067            public long getParentId() {
068                    return _parentId;
069            }
070    
071            public boolean isLeaf() {
072                    return _leaf;
073            }
074    
075            public void setChildren(List<TreeNodeView> children) {
076                    _children = children;
077            }
078    
079            public void setDepth(int depth) {
080                    _depth = depth;
081            }
082    
083            public void setHref(String href) {
084                    _href = href;
085            }
086    
087            public void setId(long id) {
088                    _id = id;
089            }
090    
091            public void setImg(String img) {
092                    _img = img;
093            }
094    
095            public void setLeaf(boolean leaf) {
096                    _leaf = leaf;
097            }
098    
099            public void setLs(String ls) {
100                    _ls = ls;
101            }
102    
103            public void setName(String name) {
104                    _name = name;
105            }
106    
107            public void setObjId(String objId) {
108                    _objId = objId;
109            }
110    
111            public void setParentId(long parentId) {
112                    _parentId = parentId;
113            }
114    
115            private List<TreeNodeView> _children = new ArrayList<TreeNodeView>();
116            private int _depth;
117            private String _href = "javascript:;";
118            private long _id;
119            private String _img = StringPool.BLANK;
120            private boolean _leaf;
121            private String _ls = StringPool.BLANK;
122            private String _name = StringPool.BLANK;
123            private String _objId = StringPool.BLANK;
124            private long _parentId;
125    
126    }