001 /*
002 * Copyright 2008-2014 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package griffon.pivot.support.adapters;
017
018 import griffon.core.CallableWithArgs;
019
020 /**
021 * @author Andres Almiray
022 * @since 2.0.0
023 */
024 public class SpinnerBindingAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.SpinnerBindingListener {
025 private CallableWithArgs<Void> selectedItemKeyChanged;
026 private CallableWithArgs<Void> selectedItemBindTypeChanged;
027 private CallableWithArgs<Void> selectedItemBindMappingChanged;
028 private CallableWithArgs<Void> spinnerDataKeyChanged;
029 private CallableWithArgs<Void> spinnerDataBindTypeChanged;
030 private CallableWithArgs<Void> spinnerDataBindMappingChanged;
031
032 public CallableWithArgs<Void> getSelectedItemKeyChanged() {
033 return this.selectedItemKeyChanged;
034 }
035
036 public CallableWithArgs<Void> getSelectedItemBindTypeChanged() {
037 return this.selectedItemBindTypeChanged;
038 }
039
040 public CallableWithArgs<Void> getSelectedItemBindMappingChanged() {
041 return this.selectedItemBindMappingChanged;
042 }
043
044 public CallableWithArgs<Void> getSpinnerDataKeyChanged() {
045 return this.spinnerDataKeyChanged;
046 }
047
048 public CallableWithArgs<Void> getSpinnerDataBindTypeChanged() {
049 return this.spinnerDataBindTypeChanged;
050 }
051
052 public CallableWithArgs<Void> getSpinnerDataBindMappingChanged() {
053 return this.spinnerDataBindMappingChanged;
054 }
055
056
057 public void setSelectedItemKeyChanged(CallableWithArgs<Void> selectedItemKeyChanged) {
058 this.selectedItemKeyChanged = selectedItemKeyChanged;
059 }
060
061 public void setSelectedItemBindTypeChanged(CallableWithArgs<Void> selectedItemBindTypeChanged) {
062 this.selectedItemBindTypeChanged = selectedItemBindTypeChanged;
063 }
064
065 public void setSelectedItemBindMappingChanged(CallableWithArgs<Void> selectedItemBindMappingChanged) {
066 this.selectedItemBindMappingChanged = selectedItemBindMappingChanged;
067 }
068
069 public void setSpinnerDataKeyChanged(CallableWithArgs<Void> spinnerDataKeyChanged) {
070 this.spinnerDataKeyChanged = spinnerDataKeyChanged;
071 }
072
073 public void setSpinnerDataBindTypeChanged(CallableWithArgs<Void> spinnerDataBindTypeChanged) {
074 this.spinnerDataBindTypeChanged = spinnerDataBindTypeChanged;
075 }
076
077 public void setSpinnerDataBindMappingChanged(CallableWithArgs<Void> spinnerDataBindMappingChanged) {
078 this.spinnerDataBindMappingChanged = spinnerDataBindMappingChanged;
079 }
080
081
082 public void selectedItemKeyChanged(org.apache.pivot.wtk.Spinner arg0, java.lang.String arg1) {
083 if (selectedItemKeyChanged != null) {
084 selectedItemKeyChanged.call(arg0, arg1);
085 }
086 }
087
088 public void selectedItemBindTypeChanged(org.apache.pivot.wtk.Spinner arg0, org.apache.pivot.wtk.BindType arg1) {
089 if (selectedItemBindTypeChanged != null) {
090 selectedItemBindTypeChanged.call(arg0, arg1);
091 }
092 }
093
094 public void selectedItemBindMappingChanged(org.apache.pivot.wtk.Spinner arg0, org.apache.pivot.wtk.Spinner.ItemBindMapping arg1) {
095 if (selectedItemBindMappingChanged != null) {
096 selectedItemBindMappingChanged.call(arg0, arg1);
097 }
098 }
099
100 public void spinnerDataKeyChanged(org.apache.pivot.wtk.Spinner arg0, java.lang.String arg1) {
101 if (spinnerDataKeyChanged != null) {
102 spinnerDataKeyChanged.call(arg0, arg1);
103 }
104 }
105
106 public void spinnerDataBindTypeChanged(org.apache.pivot.wtk.Spinner arg0, org.apache.pivot.wtk.BindType arg1) {
107 if (spinnerDataBindTypeChanged != null) {
108 spinnerDataBindTypeChanged.call(arg0, arg1);
109 }
110 }
111
112 public void spinnerDataBindMappingChanged(org.apache.pivot.wtk.Spinner arg0, org.apache.pivot.wtk.Spinner.SpinnerDataBindMapping arg1) {
113 if (spinnerDataBindMappingChanged != null) {
114 spinnerDataBindMappingChanged.call(arg0, arg1);
115 }
116 }
117
118 }
|