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