|
@@ -1,57 +1,57 @@ |
1 |
|
- |
/* |
2 |
|
- |
* Copyright 2009 Google Inc. |
3 |
|
- |
* |
4 |
|
- |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
5 |
|
- |
* use this file except in compliance with the License. You may obtain a copy of |
6 |
|
- |
* the License at |
7 |
|
- |
* |
8 |
|
- |
* http://www.apache.org/licenses/LICENSE-2.0 |
9 |
|
- |
* |
10 |
|
- |
* Unless required by applicable law or agreed to in writing, software |
11 |
|
- |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
12 |
|
- |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
13 |
|
- |
* License for the specific language governing permissions and limitations under |
14 |
|
- |
* the License. |
15 |
|
- |
*/ |
16 |
|
- |
package com.google.gwt.gen2.table.client.property; |
17 |
|
- |
|
18 |
|
- |
/** |
19 |
|
- |
* A {@link ColumnProperty} that describes whether or not the contents of the |
20 |
|
- |
* column can be sorted. |
21 |
|
- |
*/ |
22 |
|
- |
public class SortableProperty extends ColumnProperty { |
23 |
|
- |
/** |
24 |
|
- |
* Property type. |
25 |
|
- |
*/ |
26 |
|
- |
public static final Type<SortableProperty> TYPE = new Type<SortableProperty>() { |
27 |
|
- |
private SortableProperty instance; |
28 |
|
- |
|
29 |
|
- |
@Override |
30 |
|
- |
public SortableProperty getDefault() { |
31 |
|
- |
if ( instance == null ) { |
32 |
|
- |
instance = new SortableProperty( true ); |
33 |
|
- |
} |
34 |
|
- |
return instance; |
35 |
|
- |
} |
36 |
|
- |
}; |
37 |
|
- |
|
38 |
|
- |
private boolean isSortable; |
39 |
|
- |
|
40 |
|
- |
/** |
41 |
|
- |
* Construct a new {@link SortableProperty}. |
42 |
|
- |
* |
43 |
|
- |
* @param isSortable true if the column is sortable, false if not |
44 |
|
- |
*/ |
45 |
|
- |
public SortableProperty( boolean isSortable ) { |
46 |
|
- |
this.isSortable = isSortable; |
47 |
|
- |
} |
48 |
|
- |
|
49 |
|
- |
/** |
50 |
|
- |
* Returns true if the column is sortable, false if it is not. |
51 |
|
- |
* |
52 |
|
- |
* @return true if the column is sortable, false if it is not sortable |
53 |
|
- |
*/ |
54 |
|
- |
public boolean isColumnSortable() { |
55 |
|
- |
return isSortable; |
56 |
|
- |
} |
57 |
|
- |
} |
|
1 |
+ |
/* |
|
2 |
+ |
* Copyright 2009 Google Inc. |
|
3 |
+ |
* |
|
4 |
+ |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
|
5 |
+ |
* use this file except in compliance with the License. You may obtain a copy of |
|
6 |
+ |
* the License at |
|
7 |
+ |
* |
|
8 |
+ |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
+ |
* |
|
10 |
+ |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
+ |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
|
12 |
+ |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
|
13 |
+ |
* License for the specific language governing permissions and limitations under |
|
14 |
+ |
* the License. |
|
15 |
+ |
*/ |
|
16 |
+ |
package com.google.gwt.gen2.table.client.property; |
|
17 |
+ |
|
|
18 |
+ |
/** |
|
19 |
+ |
* A {@link ColumnProperty} that describes whether or not the contents of the |
|
20 |
+ |
* column can be sorted. |
|
21 |
+ |
*/ |
|
22 |
+ |
public class SortableProperty extends ColumnProperty { |
|
23 |
+ |
/** |
|
24 |
+ |
* Property type. |
|
25 |
+ |
*/ |
|
26 |
+ |
public static final Type<SortableProperty> TYPE = new Type<SortableProperty>() { |
|
27 |
+ |
private SortableProperty instance; |
|
28 |
+ |
|
|
29 |
+ |
@Override |
|
30 |
+ |
public SortableProperty getDefault() { |
|
31 |
+ |
if ( instance == null ) { |
|
32 |
+ |
instance = new SortableProperty( true ); |
|
33 |
+ |
} |
|
34 |
+ |
return instance; |
|
35 |
+ |
} |
|
36 |
+ |
}; |
|
37 |
+ |
|
|
38 |
+ |
private boolean isSortable; |
|
39 |
+ |
|
|
40 |
+ |
/** |
|
41 |
+ |
* Construct a new {@link SortableProperty}. |
|
42 |
+ |
* |
|
43 |
+ |
* @param isSortable true if the column is sortable, false if not |
|
44 |
+ |
*/ |
|
45 |
+ |
public SortableProperty( boolean isSortable ) { |
|
46 |
+ |
this.isSortable = isSortable; |
|
47 |
+ |
} |
|
48 |
+ |
|
|
49 |
+ |
/** |
|
50 |
+ |
* Returns true if the column is sortable, false if it is not. |
|
51 |
+ |
* |
|
52 |
+ |
* @return true if the column is sortable, false if it is not sortable |
|
53 |
+ |
*/ |
|
54 |
+ |
public boolean isColumnSortable() { |
|
55 |
+ |
return isSortable; |
|
56 |
+ |
} |
|
57 |
+ |
} |