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 ListButtonBindingAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.ListButtonBindingListener {
025 private CallableWithArgs<Void> listDataKeyChanged;
026 private CallableWithArgs<Void> listDataBindTypeChanged;
027 private CallableWithArgs<Void> listDataBindMappingChanged;
028 private CallableWithArgs<Void> selectedItemKeyChanged;
029 private CallableWithArgs<Void> selectedItemBindTypeChanged;
030 private CallableWithArgs<Void> selectedItemBindMappingChanged;
031
032 public CallableWithArgs<Void> getListDataKeyChanged() {
033 return this.listDataKeyChanged;
034 }
035
036 public CallableWithArgs<Void> getListDataBindTypeChanged() {
037 return this.listDataBindTypeChanged;
038 }
039
040 public CallableWithArgs<Void> getListDataBindMappingChanged() {
041 return this.listDataBindMappingChanged;
042 }
043
044 public CallableWithArgs<Void> getSelectedItemKeyChanged() {
045 return this.selectedItemKeyChanged;
046 }
047
048 public CallableWithArgs<Void> getSelectedItemBindTypeChanged() {
049 return this.selectedItemBindTypeChanged;
050 }
051
052 public CallableWithArgs<Void> getSelectedItemBindMappingChanged() {
053 return this.selectedItemBindMappingChanged;
054 }
055
056
057 public void setListDataKeyChanged(CallableWithArgs<Void> listDataKeyChanged) {
058 this.listDataKeyChanged = listDataKeyChanged;
059 }
060
061 public void setListDataBindTypeChanged(CallableWithArgs<Void> listDataBindTypeChanged) {
062 this.listDataBindTypeChanged = listDataBindTypeChanged;
063 }
064
065 public void setListDataBindMappingChanged(CallableWithArgs<Void> listDataBindMappingChanged) {
066 this.listDataBindMappingChanged = listDataBindMappingChanged;
067 }
068
069 public void setSelectedItemKeyChanged(CallableWithArgs<Void> selectedItemKeyChanged) {
070 this.selectedItemKeyChanged = selectedItemKeyChanged;
071 }
072
073 public void setSelectedItemBindTypeChanged(CallableWithArgs<Void> selectedItemBindTypeChanged) {
074 this.selectedItemBindTypeChanged = selectedItemBindTypeChanged;
075 }
076
077 public void setSelectedItemBindMappingChanged(CallableWithArgs<Void> selectedItemBindMappingChanged) {
078 this.selectedItemBindMappingChanged = selectedItemBindMappingChanged;
079 }
080
081
082 public void listDataKeyChanged(org.apache.pivot.wtk.ListButton arg0, java.lang.String arg1) {
083 if (listDataKeyChanged != null) {
084 listDataKeyChanged.call(arg0, arg1);
085 }
086 }
087
088 public void listDataBindTypeChanged(org.apache.pivot.wtk.ListButton arg0, org.apache.pivot.wtk.BindType arg1) {
089 if (listDataBindTypeChanged != null) {
090 listDataBindTypeChanged.call(arg0, arg1);
091 }
092 }
093
094 public void listDataBindMappingChanged(org.apache.pivot.wtk.ListButton arg0, org.apache.pivot.wtk.ListView.ListDataBindMapping arg1) {
095 if (listDataBindMappingChanged != null) {
096 listDataBindMappingChanged.call(arg0, arg1);
097 }
098 }
099
100 public void selectedItemKeyChanged(org.apache.pivot.wtk.ListButton arg0, java.lang.String arg1) {
101 if (selectedItemKeyChanged != null) {
102 selectedItemKeyChanged.call(arg0, arg1);
103 }
104 }
105
106 public void selectedItemBindTypeChanged(org.apache.pivot.wtk.ListButton arg0, org.apache.pivot.wtk.BindType arg1) {
107 if (selectedItemBindTypeChanged != null) {
108 selectedItemBindTypeChanged.call(arg0, arg1);
109 }
110 }
111
112 public void selectedItemBindMappingChanged(org.apache.pivot.wtk.ListButton arg0, org.apache.pivot.wtk.ListView.ItemBindMapping arg1) {
113 if (selectedItemBindMappingChanged != null) {
114 selectedItemBindMappingChanged.call(arg0, arg1);
115 }
116 }
117
118 }
|