View Javadoc

1   /*
2    * Copyright 2005-2008 The Kuali Foundation
3    * 
4    * 
5    * Licensed under the Educational Community License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    * 
9    * http://www.opensource.org/licenses/ecl2.php
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.kuali.rice.kew.web;
18  
19  import java.util.ArrayList;
20  import java.util.List;
21  
22  /**
23   * A tree of boolean flags which represent the state of show/hide for the GUI.
24   * 
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public class ShowHideTree implements java.io.Serializable {
28  
29  	private static final long serialVersionUID = 6048341469002946402L;
30  
31  	private Boolean show = Boolean.TRUE;
32      private List children = new ArrayList();
33      
34      public ShowHideTree() {
35      }
36      
37      public List getChildren() {
38          return children;
39      }
40      
41      public void setChildren(List children) {
42          this.children = children;
43      }
44          
45      public ShowHideTree getChild(Integer value) {
46          return getChild(value.intValue());
47      }
48      
49      public ShowHideTree getChild(int value) {
50          for (int index = children.size(); index <= value; index++) {
51              children.add(new ShowHideTree());
52          }
53          return (ShowHideTree)children.get(value);
54      }
55      
56      public ShowHideTree append() {
57          return getChild(children.size());
58      }
59      
60      public ShowHideTree remove(Integer index) {
61          return remove(index.intValue());
62      }
63      
64      public ShowHideTree remove(int index) {
65          return (ShowHideTree)children.remove(index);
66      }
67          
68      public Boolean getShow() {
69          return show;
70      }
71      
72      public void setShow(Boolean show) {
73          this.show = show;
74      }
75          
76  }