TableViewRowAdapter.java
001 /*
002  * Copyright 2008-2015 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 TableViewRowAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TableViewRowListener {
025     private CallableWithArgs<Void> rowsCleared;
026     private CallableWithArgs<Void> rowsSorted;
027     private CallableWithArgs<Void> rowsRemoved;
028     private CallableWithArgs<Void> rowUpdated;
029     private CallableWithArgs<Void> rowInserted;
030 
031     public CallableWithArgs<Void> getRowsCleared() {
032         return this.rowsCleared;
033     }
034 
035     public CallableWithArgs<Void> getRowsSorted() {
036         return this.rowsSorted;
037     }
038 
039     public CallableWithArgs<Void> getRowsRemoved() {
040         return this.rowsRemoved;
041     }
042 
043     public CallableWithArgs<Void> getRowUpdated() {
044         return this.rowUpdated;
045     }
046 
047     public CallableWithArgs<Void> getRowInserted() {
048         return this.rowInserted;
049     }
050 
051 
052     public void setRowsCleared(CallableWithArgs<Void> rowsCleared) {
053         this.rowsCleared = rowsCleared;
054     }
055 
056     public void setRowsSorted(CallableWithArgs<Void> rowsSorted) {
057         this.rowsSorted = rowsSorted;
058     }
059 
060     public void setRowsRemoved(CallableWithArgs<Void> rowsRemoved) {
061         this.rowsRemoved = rowsRemoved;
062     }
063 
064     public void setRowUpdated(CallableWithArgs<Void> rowUpdated) {
065         this.rowUpdated = rowUpdated;
066     }
067 
068     public void setRowInserted(CallableWithArgs<Void> rowInserted) {
069         this.rowInserted = rowInserted;
070     }
071 
072 
073     public void rowsCleared(org.apache.pivot.wtk.TableView arg0) {
074         if (rowsCleared != null) {
075             rowsCleared.call(arg0);
076         }
077     }
078 
079     public void rowsSorted(org.apache.pivot.wtk.TableView arg0) {
080         if (rowsSorted != null) {
081             rowsSorted.call(arg0);
082         }
083     }
084 
085     public void rowsRemoved(org.apache.pivot.wtk.TableView arg0, int arg1, int arg2) {
086         if (rowsRemoved != null) {
087             rowsRemoved.call(arg0, arg1, arg2);
088         }
089     }
090 
091     public void rowUpdated(org.apache.pivot.wtk.TableView arg0, int arg1) {
092         if (rowUpdated != null) {
093             rowUpdated.call(arg0, arg1);
094         }
095     }
096 
097     public void rowInserted(org.apache.pivot.wtk.TableView arg0, int arg1) {
098         if (rowInserted != null) {
099             rowInserted.call(arg0, arg1);
100         }
101     }
102 
103 }