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