ListViewAdapter.java
001 /*
002  * SPDX-License-Identifier: Apache-2.0
003  *
004  * Copyright 2008-2017 the original author or authors.
005  *
006  * Licensed under the Apache License, Version 2.0 (the "License");
007  * you may not use this file except in compliance with the License.
008  * You may obtain a copy of the License at
009  *
010  *     http://www.apache.org/licenses/LICENSE-2.0
011  *
012  * Unless required by applicable law or agreed to in writing, software
013  * distributed under the License is distributed on an "AS IS" BASIS,
014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015  * See the License for the specific language governing permissions and
016  * limitations under the License.
017  */
018 package griffon.pivot.support.adapters;
019 
020 import griffon.core.CallableWithArgs;
021 
022 /**
023  @author Andres Almiray
024  @since 2.0.0
025  */
026 public class ListViewAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.ListViewListener {
027     private CallableWithArgs<Void> listDataChanged;
028     private CallableWithArgs<Void> itemRendererChanged;
029     private CallableWithArgs<Void> disabledItemFilterChanged;
030     private CallableWithArgs<Void> itemEditorChanged;
031     private CallableWithArgs<Void> selectModeChanged;
032     private CallableWithArgs<Void> checkmarksEnabledChanged;
033     private CallableWithArgs<Void> disabledCheckmarkFilterChanged;
034 
035     public CallableWithArgs<Void> getListDataChanged() {
036         return this.listDataChanged;
037     }
038 
039     public CallableWithArgs<Void> getItemRendererChanged() {
040         return this.itemRendererChanged;
041     }
042 
043     public CallableWithArgs<Void> getDisabledItemFilterChanged() {
044         return this.disabledItemFilterChanged;
045     }
046 
047     public CallableWithArgs<Void> getItemEditorChanged() {
048         return this.itemEditorChanged;
049     }
050 
051     public CallableWithArgs<Void> getSelectModeChanged() {
052         return this.selectModeChanged;
053     }
054 
055     public CallableWithArgs<Void> getCheckmarksEnabledChanged() {
056         return this.checkmarksEnabledChanged;
057     }
058 
059     public CallableWithArgs<Void> getDisabledCheckmarkFilterChanged() {
060         return this.disabledCheckmarkFilterChanged;
061     }
062 
063 
064     public void setListDataChanged(CallableWithArgs<Void> listDataChanged) {
065         this.listDataChanged = listDataChanged;
066     }
067 
068     public void setItemRendererChanged(CallableWithArgs<Void> itemRendererChanged) {
069         this.itemRendererChanged = itemRendererChanged;
070     }
071 
072     public void setDisabledItemFilterChanged(CallableWithArgs<Void> disabledItemFilterChanged) {
073         this.disabledItemFilterChanged = disabledItemFilterChanged;
074     }
075 
076     public void setItemEditorChanged(CallableWithArgs<Void> itemEditorChanged) {
077         this.itemEditorChanged = itemEditorChanged;
078     }
079 
080     public void setSelectModeChanged(CallableWithArgs<Void> selectModeChanged) {
081         this.selectModeChanged = selectModeChanged;
082     }
083 
084     public void setCheckmarksEnabledChanged(CallableWithArgs<Void> checkmarksEnabledChanged) {
085         this.checkmarksEnabledChanged = checkmarksEnabledChanged;
086     }
087 
088     public void setDisabledCheckmarkFilterChanged(CallableWithArgs<Void> disabledCheckmarkFilterChanged) {
089         this.disabledCheckmarkFilterChanged = disabledCheckmarkFilterChanged;
090     }
091 
092 
093     public void listDataChanged(org.apache.pivot.wtk.ListView arg0, org.apache.pivot.collections.List<?> arg1) {
094         if (listDataChanged != null) {
095             listDataChanged.call(arg0, arg1);
096         }
097     }
098 
099     public void itemRendererChanged(org.apache.pivot.wtk.ListView arg0, org.apache.pivot.wtk.ListView.ItemRenderer arg1) {
100         if (itemRendererChanged != null) {
101             itemRendererChanged.call(arg0, arg1);
102         }
103     }
104 
105     public void disabledItemFilterChanged(org.apache.pivot.wtk.ListView arg0, org.apache.pivot.util.Filter<?> arg1) {
106         if (disabledItemFilterChanged != null) {
107             disabledItemFilterChanged.call(arg0, arg1);
108         }
109     }
110 
111     public void itemEditorChanged(org.apache.pivot.wtk.ListView arg0, org.apache.pivot.wtk.ListView.ItemEditor arg1) {
112         if (itemEditorChanged != null) {
113             itemEditorChanged.call(arg0, arg1);
114         }
115     }
116 
117     public void selectModeChanged(org.apache.pivot.wtk.ListView arg0, org.apache.pivot.wtk.ListView.SelectMode arg1) {
118         if (selectModeChanged != null) {
119             selectModeChanged.call(arg0, arg1);
120         }
121     }
122 
123     public void checkmarksEnabledChanged(org.apache.pivot.wtk.ListView arg0) {
124         if (checkmarksEnabledChanged != null) {
125             checkmarksEnabledChanged.call(arg0);
126         }
127     }
128 
129     public void disabledCheckmarkFilterChanged(org.apache.pivot.wtk.ListView arg0, org.apache.pivot.util.Filter<?> arg1) {
130         if (disabledCheckmarkFilterChanged != null) {
131             disabledCheckmarkFilterChanged.call(arg0, arg1);
132         }
133     }
134 
135 }