KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > web > data > IDataContainer


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.web.data;
18
19 /**
20  * @author kevinr
21  */

22 public interface IDataContainer
23 {
24    /**
25     * Return the currently sorted column if any
26     *
27     * @return current sorted column if any
28     */

29    public String JavaDoc getCurrentSortColumn();
30    
31    /**
32     * Returns the current sort direction. Only valid if a sort column is set.
33     * True is returned for descending sort, false for accending sort.
34     *
35     * @return true for descending sort, false for accending sort
36     */

37    public boolean isCurrentSortDescending();
38    
39    /**
40     * Returns the current page size used for this list, or -1 for no paging.
41     */

42    public int getPageSize();
43    
44    /**
45     * Return the current page the list is displaying
46     *
47     * @return Current page with zero based index
48     */

49    public int getCurrentPage();
50    
51    /**
52     * Set the current page to display.
53     *
54     * @param index Zero based page index to display
55     */

56    public void setCurrentPage(int index);
57    
58    /**
59     * Return the count of max available pages
60     *
61     * @return count of max available pages
62     */

63    public int getPageCount();
64    
65    /**
66     * Returns true if a row of data is available
67     *
68     * @return true if data is available, false otherwise
69     */

70    public boolean isDataAvailable();
71    
72    /**
73     * Returns the next row of data from the data model
74     *
75     * @return next row of data as a Bean object
76     */

77    public Object JavaDoc nextRow();
78    
79    /**
80     * Sort the dataset using the specified sort parameters
81     *
82     * @param column Column to sort
83     * @param descending True for descending sort, false for ascending
84     * @param mode Sort mode to use (see IDataContainer constants)
85     */

86    public void sort(String JavaDoc column, boolean descending, String JavaDoc mode);
87    
88    public final static String JavaDoc SORT_CASEINSENSITIVE = "case-insensitive";
89    public final static String JavaDoc SORT_CASESENSITIVE = "case-sensitive";
90 }
91
Popular Tags