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 ListButtonAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.ListButtonListener {
025 private CallableWithArgs<Void> listDataChanged;
026 private CallableWithArgs<Void> itemRendererChanged;
027 private CallableWithArgs<Void> repeatableChanged;
028 private CallableWithArgs<Void> disabledItemFilterChanged;
029 private CallableWithArgs<Void> listSizeChanged;
030
031 public CallableWithArgs<Void> getListDataChanged() {
032 return this.listDataChanged;
033 }
034
035 public CallableWithArgs<Void> getItemRendererChanged() {
036 return this.itemRendererChanged;
037 }
038
039 public CallableWithArgs<Void> getRepeatableChanged() {
040 return this.repeatableChanged;
041 }
042
043 public CallableWithArgs<Void> getDisabledItemFilterChanged() {
044 return this.disabledItemFilterChanged;
045 }
046
047 public CallableWithArgs<Void> getListSizeChanged() {
048 return this.listSizeChanged;
049 }
050
051
052 public void setListDataChanged(CallableWithArgs<Void> listDataChanged) {
053 this.listDataChanged = listDataChanged;
054 }
055
056 public void setItemRendererChanged(CallableWithArgs<Void> itemRendererChanged) {
057 this.itemRendererChanged = itemRendererChanged;
058 }
059
060 public void setRepeatableChanged(CallableWithArgs<Void> repeatableChanged) {
061 this.repeatableChanged = repeatableChanged;
062 }
063
064 public void setDisabledItemFilterChanged(CallableWithArgs<Void> disabledItemFilterChanged) {
065 this.disabledItemFilterChanged = disabledItemFilterChanged;
066 }
067
068 public void setListSizeChanged(CallableWithArgs<Void> listSizeChanged) {
069 this.listSizeChanged = listSizeChanged;
070 }
071
072
073 public void listDataChanged(org.apache.pivot.wtk.ListButton arg0, org.apache.pivot.collections.List<?> arg1) {
074 if (listDataChanged != null) {
075 listDataChanged.call(arg0, arg1);
076 }
077 }
078
079 public void itemRendererChanged(org.apache.pivot.wtk.ListButton arg0, org.apache.pivot.wtk.ListView.ItemRenderer arg1) {
080 if (itemRendererChanged != null) {
081 itemRendererChanged.call(arg0, arg1);
082 }
083 }
084
085 public void repeatableChanged(org.apache.pivot.wtk.ListButton arg0) {
086 if (repeatableChanged != null) {
087 repeatableChanged.call(arg0);
088 }
089 }
090
091 public void disabledItemFilterChanged(org.apache.pivot.wtk.ListButton arg0, org.apache.pivot.util.Filter<?> arg1) {
092 if (disabledItemFilterChanged != null) {
093 disabledItemFilterChanged.call(arg0, arg1);
094 }
095 }
096
097 public void listSizeChanged(org.apache.pivot.wtk.ListButton arg0, int arg1) {
098 if (listSizeChanged != null) {
099 listSizeChanged.call(arg0, arg1);
100 }
101 }
102
103 }
|