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.TablePane;
023
024 /**
025 * @author Andres Almiray
026 * @since 2.0.0
027 */
028 public class TablePaneAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TablePaneListener {
029 private CallableWithArgs<Void> cellInserted;
030 private CallableWithArgs<Void> cellsRemoved;
031 private CallableWithArgs<Void> cellUpdated;
032 private CallableWithArgs<Void> rowHeightChanged;
033 private CallableWithArgs<Void> rowHighlightedChanged;
034 private CallableWithArgs<Void> columnInserted;
035 private CallableWithArgs<Void> columnsRemoved;
036 private CallableWithArgs<Void> columnWidthChanged;
037 private CallableWithArgs<Void> columnHighlightedChanged;
038 private CallableWithArgs<Void> rowsRemoved;
039 private CallableWithArgs<Void> rowInserted;
040
041 public CallableWithArgs<Void> getCellInserted() {
042 return this.cellInserted;
043 }
044
045 public CallableWithArgs<Void> getCellsRemoved() {
046 return this.cellsRemoved;
047 }
048
049 public CallableWithArgs<Void> getCellUpdated() {
050 return this.cellUpdated;
051 }
052
053 public CallableWithArgs<Void> getRowHeightChanged() {
054 return this.rowHeightChanged;
055 }
056
057 public CallableWithArgs<Void> getRowHighlightedChanged() {
058 return this.rowHighlightedChanged;
059 }
060
061 public CallableWithArgs<Void> getColumnInserted() {
062 return this.columnInserted;
063 }
064
065 public CallableWithArgs<Void> getColumnsRemoved() {
066 return this.columnsRemoved;
067 }
068
069 public CallableWithArgs<Void> getColumnWidthChanged() {
070 return this.columnWidthChanged;
071 }
072
073 public CallableWithArgs<Void> getColumnHighlightedChanged() {
074 return this.columnHighlightedChanged;
075 }
076
077 public CallableWithArgs<Void> getRowsRemoved() {
078 return this.rowsRemoved;
079 }
080
081 public CallableWithArgs<Void> getRowInserted() {
082 return this.rowInserted;
083 }
084
085
086 public void setCellInserted(CallableWithArgs<Void> cellInserted) {
087 this.cellInserted = cellInserted;
088 }
089
090 public void setCellsRemoved(CallableWithArgs<Void> cellsRemoved) {
091 this.cellsRemoved = cellsRemoved;
092 }
093
094 public void setCellUpdated(CallableWithArgs<Void> cellUpdated) {
095 this.cellUpdated = cellUpdated;
096 }
097
098 public void setRowHeightChanged(CallableWithArgs<Void> rowHeightChanged) {
099 this.rowHeightChanged = rowHeightChanged;
100 }
101
102 public void setRowHighlightedChanged(CallableWithArgs<Void> rowHighlightedChanged) {
103 this.rowHighlightedChanged = rowHighlightedChanged;
104 }
105
106 public void setColumnInserted(CallableWithArgs<Void> columnInserted) {
107 this.columnInserted = columnInserted;
108 }
109
110 public void setColumnsRemoved(CallableWithArgs<Void> columnsRemoved) {
111 this.columnsRemoved = columnsRemoved;
112 }
113
114 public void setColumnWidthChanged(CallableWithArgs<Void> columnWidthChanged) {
115 this.columnWidthChanged = columnWidthChanged;
116 }
117
118 public void setColumnHighlightedChanged(CallableWithArgs<Void> columnHighlightedChanged) {
119 this.columnHighlightedChanged = columnHighlightedChanged;
120 }
121
122 public void setRowsRemoved(CallableWithArgs<Void> rowsRemoved) {
123 this.rowsRemoved = rowsRemoved;
124 }
125
126 public void setRowInserted(CallableWithArgs<Void> rowInserted) {
127 this.rowInserted = rowInserted;
128 }
129
130
131 public void cellInserted(org.apache.pivot.wtk.TablePane.Row arg0, int arg1) {
132 if (cellInserted != null) {
133 cellInserted.call(arg0, arg1);
134 }
135 }
136
137 public void cellsRemoved(org.apache.pivot.wtk.TablePane.Row arg0, int arg1, org.apache.pivot.collections.Sequence<Component> arg2) {
138 if (cellsRemoved != null) {
139 cellsRemoved.call(arg0, arg1, arg2);
140 }
141 }
142
143 public void cellUpdated(org.apache.pivot.wtk.TablePane.Row arg0, int arg1, org.apache.pivot.wtk.Component arg2) {
144 if (cellUpdated != null) {
145 cellUpdated.call(arg0, arg1, arg2);
146 }
147 }
148
149 public void rowHeightChanged(org.apache.pivot.wtk.TablePane.Row arg0, int arg1, boolean arg2) {
150 if (rowHeightChanged != null) {
151 rowHeightChanged.call(arg0, arg1, arg2);
152 }
153 }
154
155 public void rowHighlightedChanged(org.apache.pivot.wtk.TablePane.Row arg0) {
156 if (rowHighlightedChanged != null) {
157 rowHighlightedChanged.call(arg0);
158 }
159 }
160
161 public void columnInserted(org.apache.pivot.wtk.TablePane arg0, int arg1) {
162 if (columnInserted != null) {
163 columnInserted.call(arg0, arg1);
164 }
165 }
166
167 public void columnsRemoved(org.apache.pivot.wtk.TablePane arg0, int arg1, org.apache.pivot.collections.Sequence<TablePane.Column> arg2) {
168 if (columnsRemoved != null) {
169 columnsRemoved.call(arg0, arg1, arg2);
170 }
171 }
172
173 public void columnWidthChanged(org.apache.pivot.wtk.TablePane.Column arg0, int arg1, boolean arg2) {
174 if (columnWidthChanged != null) {
175 columnWidthChanged.call(arg0, arg1, arg2);
176 }
177 }
178
179 public void columnHighlightedChanged(org.apache.pivot.wtk.TablePane.Column arg0) {
180 if (columnHighlightedChanged != null) {
181 columnHighlightedChanged.call(arg0);
182 }
183 }
184
185 public void rowsRemoved(org.apache.pivot.wtk.TablePane arg0, int arg1, org.apache.pivot.collections.Sequence<TablePane.Row> arg2) {
186 if (rowsRemoved != null) {
187 rowsRemoved.call(arg0, arg1, arg2);
188 }
189 }
190
191 public void rowInserted(org.apache.pivot.wtk.TablePane arg0, int arg1) {
192 if (rowInserted != null) {
193 rowInserted.call(arg0, arg1);
194 }
195 }
196
197 }
|