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