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