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.TableView;
020
021 /**
022 * @author Andres Almiray
023 * @since 2.0.0
024 */
025 public class TableViewColumnAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TableViewColumnListener {
026 private CallableWithArgs<Void> columnInserted;
027 private CallableWithArgs<Void> columnsRemoved;
028 private CallableWithArgs<Void> columnWidthChanged;
029 private CallableWithArgs<Void> columnNameChanged;
030 private CallableWithArgs<Void> columnHeaderDataChanged;
031 private CallableWithArgs<Void> columnHeaderDataRendererChanged;
032 private CallableWithArgs<Void> columnWidthLimitsChanged;
033 private CallableWithArgs<Void> columnFilterChanged;
034 private CallableWithArgs<Void> columnCellRendererChanged;
035
036 public CallableWithArgs<Void> getColumnInserted() {
037 return this.columnInserted;
038 }
039
040 public CallableWithArgs<Void> getColumnsRemoved() {
041 return this.columnsRemoved;
042 }
043
044 public CallableWithArgs<Void> getColumnWidthChanged() {
045 return this.columnWidthChanged;
046 }
047
048 public CallableWithArgs<Void> getColumnNameChanged() {
049 return this.columnNameChanged;
050 }
051
052 public CallableWithArgs<Void> getColumnHeaderDataChanged() {
053 return this.columnHeaderDataChanged;
054 }
055
056 public CallableWithArgs<Void> getColumnHeaderDataRendererChanged() {
057 return this.columnHeaderDataRendererChanged;
058 }
059
060 public CallableWithArgs<Void> getColumnWidthLimitsChanged() {
061 return this.columnWidthLimitsChanged;
062 }
063
064 public CallableWithArgs<Void> getColumnFilterChanged() {
065 return this.columnFilterChanged;
066 }
067
068 public CallableWithArgs<Void> getColumnCellRendererChanged() {
069 return this.columnCellRendererChanged;
070 }
071
072
073 public void setColumnInserted(CallableWithArgs<Void> columnInserted) {
074 this.columnInserted = columnInserted;
075 }
076
077 public void setColumnsRemoved(CallableWithArgs<Void> columnsRemoved) {
078 this.columnsRemoved = columnsRemoved;
079 }
080
081 public void setColumnWidthChanged(CallableWithArgs<Void> columnWidthChanged) {
082 this.columnWidthChanged = columnWidthChanged;
083 }
084
085 public void setColumnNameChanged(CallableWithArgs<Void> columnNameChanged) {
086 this.columnNameChanged = columnNameChanged;
087 }
088
089 public void setColumnHeaderDataChanged(CallableWithArgs<Void> columnHeaderDataChanged) {
090 this.columnHeaderDataChanged = columnHeaderDataChanged;
091 }
092
093 public void setColumnHeaderDataRendererChanged(CallableWithArgs<Void> columnHeaderDataRendererChanged) {
094 this.columnHeaderDataRendererChanged = columnHeaderDataRendererChanged;
095 }
096
097 public void setColumnWidthLimitsChanged(CallableWithArgs<Void> columnWidthLimitsChanged) {
098 this.columnWidthLimitsChanged = columnWidthLimitsChanged;
099 }
100
101 public void setColumnFilterChanged(CallableWithArgs<Void> columnFilterChanged) {
102 this.columnFilterChanged = columnFilterChanged;
103 }
104
105 public void setColumnCellRendererChanged(CallableWithArgs<Void> columnCellRendererChanged) {
106 this.columnCellRendererChanged = columnCellRendererChanged;
107 }
108
109
110 public void columnInserted(org.apache.pivot.wtk.TableView arg0, int arg1) {
111 if (columnInserted != null) {
112 columnInserted.call(arg0, arg1);
113 }
114 }
115
116 public void columnsRemoved(org.apache.pivot.wtk.TableView arg0, int arg1, org.apache.pivot.collections.Sequence<TableView.Column> arg2) {
117 if (columnsRemoved != null) {
118 columnsRemoved.call(arg0, arg1, arg2);
119 }
120 }
121
122 public void columnWidthChanged(org.apache.pivot.wtk.TableView.Column arg0, int arg1, boolean arg2) {
123 if (columnWidthChanged != null) {
124 columnWidthChanged.call(arg0, arg1, arg2);
125 }
126 }
127
128 public void columnNameChanged(org.apache.pivot.wtk.TableView.Column arg0, java.lang.String arg1) {
129 if (columnNameChanged != null) {
130 columnNameChanged.call(arg0, arg1);
131 }
132 }
133
134 public void columnHeaderDataChanged(org.apache.pivot.wtk.TableView.Column arg0, java.lang.Object arg1) {
135 if (columnHeaderDataChanged != null) {
136 columnHeaderDataChanged.call(arg0, arg1);
137 }
138 }
139
140 public void columnHeaderDataRendererChanged(org.apache.pivot.wtk.TableView.Column arg0, org.apache.pivot.wtk.TableView.HeaderDataRenderer arg1) {
141 if (columnHeaderDataRendererChanged != null) {
142 columnHeaderDataRendererChanged.call(arg0, arg1);
143 }
144 }
145
146 public void columnWidthLimitsChanged(org.apache.pivot.wtk.TableView.Column arg0, int arg1, int arg2) {
147 if (columnWidthLimitsChanged != null) {
148 columnWidthLimitsChanged.call(arg0, arg1, arg2);
149 }
150 }
151
152 public void columnFilterChanged(org.apache.pivot.wtk.TableView.Column arg0, java.lang.Object arg1) {
153 if (columnFilterChanged != null) {
154 columnFilterChanged.call(arg0, arg1);
155 }
156 }
157
158 public void columnCellRendererChanged(org.apache.pivot.wtk.TableView.Column arg0, org.apache.pivot.wtk.TableView.CellRenderer arg1) {
159 if (columnCellRendererChanged != null) {
160 columnCellRendererChanged.call(arg0, arg1);
161 }
162 }
163
164 }
|