1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20 package org.apache.myfaces.custom.tree2; 21 22 import java.util.List; 23 import java.io.Serializable; 24 25 /** 26 * Defines the requirements for an object that can be used as a tree node for 27 * use in a {@link UITreeData} component. (inspired by javax.swing.tree.TreeNode). 28 * 29 * @author Sean Schofield 30 * @version $Revision: 472638 $ $Date: 2006-11-08 15:54:13 -0500 (Wed, 08 Nov 2006) $ 31 */ 32 33 public interface TreeNode extends Serializable 34 { 35 public boolean isLeaf(); 36 37 public void setLeaf(boolean leaf); 38 39 public List getChildren(); 40 41 /** 42 * Gets the type of {@link TreeNode}. 43 * @return The node type 44 */ 45 public String getType(); 46 47 48 /** 49 * Sets the type of {@link TreeNode}. 50 * @param type The node type 51 */ 52 public void setType(String type); 53 54 55 public String getDescription(); 56 57 58 public void setDescription(String description); 59 60 61 /** 62 * Sets the identifier associated with the {@link TreeNode}. 63 * @param identifier The identifier 64 */ 65 public void setIdentifier(String identifier); 66 67 68 /** 69 * Gets the identifier asociated with the {@link TreeNode}. 70 * @return the identifier 71 */ 72 public String getIdentifier(); 73 74 75 /** 76 * Gets the number of children this node has. 77 * @return the number of children 78 */ 79 public int getChildCount(); 80 81 /* 82 public TreeNode getParentNode(); 83 84 public void setParentNode(TreeNode parent); 85 */ 86 87 }