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