01 /*
02 * SPDX-License-Identifier: Apache-2.0
03 *
04 * Copyright 2008-2017 the original author or authors.
05 *
06 * Licensed under the Apache License, Version 2.0 (the "License");
07 * you may not use this file except in compliance with the License.
08 * You may obtain a copy of the License at
09 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 package griffon.pivot.support.adapters;
19
20 import griffon.core.CallableWithArgs;
21
22 /**
23 * @author Andres Almiray
24 * @since 2.0.0
25 */
26 public class TableViewSortAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TableViewSortListener {
27 private CallableWithArgs<Void> sortChanged;
28 private CallableWithArgs<Void> sortAdded;
29 private CallableWithArgs<Void> sortUpdated;
30 private CallableWithArgs<Void> sortRemoved;
31
32 public CallableWithArgs<Void> getSortChanged() {
33 return this.sortChanged;
34 }
35
36 public CallableWithArgs<Void> getSortAdded() {
37 return this.sortAdded;
38 }
39
40 public CallableWithArgs<Void> getSortUpdated() {
41 return this.sortUpdated;
42 }
43
44 public CallableWithArgs<Void> getSortRemoved() {
45 return this.sortRemoved;
46 }
47
48
49 public void setSortChanged(CallableWithArgs<Void> sortChanged) {
50 this.sortChanged = sortChanged;
51 }
52
53 public void setSortAdded(CallableWithArgs<Void> sortAdded) {
54 this.sortAdded = sortAdded;
55 }
56
57 public void setSortUpdated(CallableWithArgs<Void> sortUpdated) {
58 this.sortUpdated = sortUpdated;
59 }
60
61 public void setSortRemoved(CallableWithArgs<Void> sortRemoved) {
62 this.sortRemoved = sortRemoved;
63 }
64
65
66 public void sortChanged(org.apache.pivot.wtk.TableView arg0) {
67 if (sortChanged != null) {
68 sortChanged.call(arg0);
69 }
70 }
71
72 public void sortAdded(org.apache.pivot.wtk.TableView arg0, java.lang.String arg1) {
73 if (sortAdded != null) {
74 sortAdded.call(arg0, arg1);
75 }
76 }
77
78 public void sortUpdated(org.apache.pivot.wtk.TableView arg0, java.lang.String arg1, org.apache.pivot.wtk.SortDirection arg2) {
79 if (sortUpdated != null) {
80 sortUpdated.call(arg0, arg1, arg2);
81 }
82 }
83
84 public void sortRemoved(org.apache.pivot.wtk.TableView arg0, java.lang.String arg1, org.apache.pivot.wtk.SortDirection arg2) {
85 if (sortRemoved != null) {
86 sortRemoved.call(arg0, arg1, arg2);
87 }
88 }
89
90 }
|