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  
20  package org.apache.myfaces.tobago.model;
21  
22  import javax.faces.model.DataModel;
23  import java.util.List;
24  
25  /**
26   * Abstract class that represents the data model for a tree.
27   */
28  public abstract class TreeDataModel<E> extends DataModel<E> {
29  
30    public abstract void reset();
31  
32    public abstract void update(ExpandedState expandedState);
33  
34    @Override
35    public abstract int getRowCount();
36  
37    @Override
38    public abstract int getRowIndex();
39  
40    public abstract int getLevel();
41  
42    public abstract TreePath getPath();
43  
44    public abstract int getDepth();
45  
46    public abstract boolean isFolder();
47  
48    @Override
49    public abstract E getWrappedData();
50  
51    @Override
52    public abstract boolean isRowAvailable();
53  
54    @Override
55    public abstract void setRowIndex(int rowIndex);
56  
57    @Override
58    public abstract void setWrappedData(Object data);
59  
60    public abstract boolean isRowVisible();
61  
62    public abstract String getRowClientId();
63  
64    public abstract void setRowClientId(String clientId);
65  
66    public abstract String getRowParentClientId();
67  
68    public abstract List<Integer> getRowIndicesOfChildren();
69  
70    public abstract List<Boolean> getJunctions();
71  }