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 import org.apache.pivot.util.CalendarDate;
22
23 /**
24 * @author Andres Almiray
25 * @since 2.0.0
26 */
27 public class CalendarButtonAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.CalendarButtonListener {
28 private CallableWithArgs<Void> monthChanged;
29 private CallableWithArgs<Void> localeChanged;
30 private CallableWithArgs<Void> disabledDateFilterChanged;
31 private CallableWithArgs<Void> yearChanged;
32
33 public CallableWithArgs<Void> getMonthChanged() {
34 return this.monthChanged;
35 }
36
37 public CallableWithArgs<Void> getLocaleChanged() {
38 return this.localeChanged;
39 }
40
41 public CallableWithArgs<Void> getDisabledDateFilterChanged() {
42 return this.disabledDateFilterChanged;
43 }
44
45 public CallableWithArgs<Void> getYearChanged() {
46 return this.yearChanged;
47 }
48
49
50 public void setMonthChanged(CallableWithArgs<Void> monthChanged) {
51 this.monthChanged = monthChanged;
52 }
53
54 public void setLocaleChanged(CallableWithArgs<Void> localeChanged) {
55 this.localeChanged = localeChanged;
56 }
57
58 public void setDisabledDateFilterChanged(CallableWithArgs<Void> disabledDateFilterChanged) {
59 this.disabledDateFilterChanged = disabledDateFilterChanged;
60 }
61
62 public void setYearChanged(CallableWithArgs<Void> yearChanged) {
63 this.yearChanged = yearChanged;
64 }
65
66
67 public void monthChanged(org.apache.pivot.wtk.CalendarButton arg0, int arg1) {
68 if (monthChanged != null) {
69 monthChanged.call(arg0, arg1);
70 }
71 }
72
73 public void localeChanged(org.apache.pivot.wtk.CalendarButton arg0, java.util.Locale arg1) {
74 if (localeChanged != null) {
75 localeChanged.call(arg0, arg1);
76 }
77 }
78
79 public void disabledDateFilterChanged(org.apache.pivot.wtk.CalendarButton arg0, org.apache.pivot.util.Filter<CalendarDate> arg1) {
80 if (disabledDateFilterChanged != null) {
81 disabledDateFilterChanged.call(arg0, arg1);
82 }
83 }
84
85 public void yearChanged(org.apache.pivot.wtk.CalendarButton arg0, int arg1) {
86 if (yearChanged != null) {
87 yearChanged.call(arg0, arg1);
88 }
89 }
90
91 }
|