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