KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > contrib > table > model > simple > SimpleTableSortingState


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.contrib.table.model.simple;
16
17 import java.io.Serializable JavaDoc;
18
19 import org.apache.tapestry.contrib.table.model.ITableSortingState;
20
21 /**
22  * A minimal implementation of
23  * {@link org.apache.tapestry.contrib.table.model.ITableSortingState}
24  *
25  * @author mindbridge
26  */

27 public class SimpleTableSortingState
28     implements ITableSortingState, Serializable JavaDoc
29 {
30     private static final long serialVersionUID = 1L;
31     
32     private String JavaDoc m_strSortColumn;
33     private boolean m_bSortOrder;
34
35     public SimpleTableSortingState()
36     {
37         this(null, ITableSortingState.SORT_ASCENDING);
38     }
39
40     public SimpleTableSortingState(String JavaDoc strSortColumn, boolean bSortOrder)
41     {
42         m_strSortColumn = strSortColumn;
43         m_bSortOrder = bSortOrder;
44     }
45     
46     /**
47      * Returns the SortOrder.
48      * @return boolean
49      */

50     public boolean getSortOrder()
51     {
52         return m_bSortOrder;
53     }
54
55     /**
56      * Returns the SortColumn.
57      * @return int
58      */

59     public String JavaDoc getSortColumn()
60     {
61         return m_strSortColumn;
62     }
63
64     /**
65      * Sets the SortColumn.
66      * @param strSortColumn The SortColumn to set
67      */

68     public void setSortColumn(String JavaDoc strSortColumn, boolean bSortOrder)
69     {
70         m_strSortColumn = strSortColumn;
71         m_bSortOrder = bSortOrder;
72     }
73
74 }
75
Popular Tags