View Javadoc

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  package org.apache.myfaces.custom.tree2;
20  
21  import java.io.Serializable;
22  
23  public interface TreeState extends Serializable
24  {
25  
26      /**
27       * Indicates whether or not the specified {@link TreeNode} is expanded.
28       *
29       * @param nodeId The id of the node in question.
30       * @return If the node is expanded.
31       */
32      public boolean isNodeExpanded(String nodeId);
33  
34      /**
35       * Toggle the expanded state of the specified {@link TreeNode}.
36       * @param nodeId The id of the node whose expanded state should be toggled.
37       */
38      public void toggleExpanded(String nodeId);
39  
40      /**
41       * Expand the complete path specified.  If any node in the path is already expanded,
42       * that node should be left as it is.
43       *
44       * @param nodePath The path to be expanded.
45       */
46      public void expandPath(String[] nodePath);
47  
48      /**
49       * Collapse the complete path specified.  If any node in the path is already collapsed,
50       * that node should be left as it is.
51       *
52       * @param nodePath The path to be collapsed.
53       */
54      public void collapsePath(String[] nodePath);
55  
56      /**
57       * Getter for transient property.
58       * @return boolean
59       */
60      public boolean isTransient();
61  
62      /**
63       * Setter for transient property
64       * @param trans boolean
65       */
66      public void setTransient(boolean trans);
67  
68      /**
69       * Sets the id of the currently selected node
70       * @param nodeId The id of the currently selected node
71       */
72      public void setSelected(String nodeId);
73  
74      /**
75       * Indicates whether or not the specified node is selected.
76       * @param nodeId String
77       * @return boolean
78       */
79      public boolean isSelected(String nodeId);
80  }