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 ListViewItemAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.ListViewItemListener {
025 private CallableWithArgs<Void> itemsCleared;
026 private CallableWithArgs<Void> itemsSorted;
027 private CallableWithArgs<Void> itemInserted;
028 private CallableWithArgs<Void> itemUpdated;
029 private CallableWithArgs<Void> itemsRemoved;
030
031 public CallableWithArgs<Void> getItemsCleared() {
032 return this.itemsCleared;
033 }
034
035 public CallableWithArgs<Void> getItemsSorted() {
036 return this.itemsSorted;
037 }
038
039 public CallableWithArgs<Void> getItemInserted() {
040 return this.itemInserted;
041 }
042
043 public CallableWithArgs<Void> getItemUpdated() {
044 return this.itemUpdated;
045 }
046
047 public CallableWithArgs<Void> getItemsRemoved() {
048 return this.itemsRemoved;
049 }
050
051
052 public void setItemsCleared(CallableWithArgs<Void> itemsCleared) {
053 this.itemsCleared = itemsCleared;
054 }
055
056 public void setItemsSorted(CallableWithArgs<Void> itemsSorted) {
057 this.itemsSorted = itemsSorted;
058 }
059
060 public void setItemInserted(CallableWithArgs<Void> itemInserted) {
061 this.itemInserted = itemInserted;
062 }
063
064 public void setItemUpdated(CallableWithArgs<Void> itemUpdated) {
065 this.itemUpdated = itemUpdated;
066 }
067
068 public void setItemsRemoved(CallableWithArgs<Void> itemsRemoved) {
069 this.itemsRemoved = itemsRemoved;
070 }
071
072
073 public void itemsCleared(org.apache.pivot.wtk.ListView arg0) {
074 if (itemsCleared != null) {
075 itemsCleared.call(arg0);
076 }
077 }
078
079 public void itemsSorted(org.apache.pivot.wtk.ListView arg0) {
080 if (itemsSorted != null) {
081 itemsSorted.call(arg0);
082 }
083 }
084
085 public void itemInserted(org.apache.pivot.wtk.ListView arg0, int arg1) {
086 if (itemInserted != null) {
087 itemInserted.call(arg0, arg1);
088 }
089 }
090
091 public void itemUpdated(org.apache.pivot.wtk.ListView arg0, int arg1) {
092 if (itemUpdated != null) {
093 itemUpdated.call(arg0, arg1);
094 }
095 }
096
097 public void itemsRemoved(org.apache.pivot.wtk.ListView arg0, int arg1, int arg2) {
098 if (itemsRemoved != null) {
099 itemsRemoved.call(arg0, arg1, arg2);
100 }
101 }
102
103 }
|