01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket.extensions.markup.html.repeater.data.sort;
18:
19: import org.apache.wicket.IClusterable;
20:
21: /**
22: * Interface used by OrderByLink to interact with any object that keeps track of
23: * sorting state
24: *
25: * @author Igor Vaynberg (ivaynberg)
26: *
27: */
28: public interface ISortState extends IClusterable {
29: /**
30: * property state representing ascending sort order
31: */
32: public static final int ASCENDING = 1;
33: /**
34: * property state representing descending sort order
35: */
36: public static final int DESCENDING = -1;
37: /**
38: * property state presenting not-sorted sort order
39: */
40: public static final int NONE = 0;
41:
42: /**
43: * Sets sort order of the property
44: *
45: * @param property
46: * the name of the property to sort on
47: * @param state
48: * new sort state of the property. must be one of ASCENDING,
49: * DESCENDING, or NONE
50: */
51: public void setPropertySortOrder(String property, int state);
52:
53: /**
54: * Gets the sort order of a property
55: *
56: * @param property
57: * sort property to be checked
58: * @return one of ASCENDING, DESCENDING, or NONE
59: */
60: public int getPropertySortOrder(String property);
61:
62: }
|