GridPaneAdapter.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 import org.apache.pivot.wtk.Component;
022 import org.apache.pivot.wtk.GridPane;
023 
024 /**
025  @author Andres Almiray
026  @since 2.0.0
027  */
028 public class GridPaneAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.GridPaneListener {
029     private CallableWithArgs<Void> columnCountChanged;
030     private CallableWithArgs<Void> cellInserted;
031     private CallableWithArgs<Void> cellsRemoved;
032     private CallableWithArgs<Void> cellUpdated;
033     private CallableWithArgs<Void> rowsRemoved;
034     private CallableWithArgs<Void> rowInserted;
035 
036     public CallableWithArgs<Void> getColumnCountChanged() {
037         return this.columnCountChanged;
038     }
039 
040     public CallableWithArgs<Void> getCellInserted() {
041         return this.cellInserted;
042     }
043 
044     public CallableWithArgs<Void> getCellsRemoved() {
045         return this.cellsRemoved;
046     }
047 
048     public CallableWithArgs<Void> getCellUpdated() {
049         return this.cellUpdated;
050     }
051 
052     public CallableWithArgs<Void> getRowsRemoved() {
053         return this.rowsRemoved;
054     }
055 
056     public CallableWithArgs<Void> getRowInserted() {
057         return this.rowInserted;
058     }
059 
060 
061     public void setColumnCountChanged(CallableWithArgs<Void> columnCountChanged) {
062         this.columnCountChanged = columnCountChanged;
063     }
064 
065     public void setCellInserted(CallableWithArgs<Void> cellInserted) {
066         this.cellInserted = cellInserted;
067     }
068 
069     public void setCellsRemoved(CallableWithArgs<Void> cellsRemoved) {
070         this.cellsRemoved = cellsRemoved;
071     }
072 
073     public void setCellUpdated(CallableWithArgs<Void> cellUpdated) {
074         this.cellUpdated = cellUpdated;
075     }
076 
077     public void setRowsRemoved(CallableWithArgs<Void> rowsRemoved) {
078         this.rowsRemoved = rowsRemoved;
079     }
080 
081     public void setRowInserted(CallableWithArgs<Void> rowInserted) {
082         this.rowInserted = rowInserted;
083     }
084 
085 
086     public void columnCountChanged(org.apache.pivot.wtk.GridPane arg0, int arg1) {
087         if (columnCountChanged != null) {
088             columnCountChanged.call(arg0, arg1);
089         }
090     }
091 
092     public void cellInserted(org.apache.pivot.wtk.GridPane.Row arg0, int arg1) {
093         if (cellInserted != null) {
094             cellInserted.call(arg0, arg1);
095         }
096     }
097 
098     public void cellsRemoved(org.apache.pivot.wtk.GridPane.Row arg0, int arg1, org.apache.pivot.collections.Sequence<Component> arg2) {
099         if (cellsRemoved != null) {
100             cellsRemoved.call(arg0, arg1, arg2);
101         }
102     }
103 
104     public void cellUpdated(org.apache.pivot.wtk.GridPane.Row arg0, int arg1, org.apache.pivot.wtk.Component arg2) {
105         if (cellUpdated != null) {
106             cellUpdated.call(arg0, arg1, arg2);
107         }
108     }
109 
110     public void rowsRemoved(org.apache.pivot.wtk.GridPane arg0, int arg1, org.apache.pivot.collections.Sequence<GridPane.Row> arg2) {
111         if (rowsRemoved != null) {
112             rowsRemoved.call(arg0, arg1, arg2);
113         }
114     }
115 
116     public void rowInserted(org.apache.pivot.wtk.GridPane arg0, int arg1) {
117         if (rowInserted != null) {
118             rowInserted.call(arg0, arg1);
119         }
120     }
121 
122 }