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