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
022 /**
023 * @author Andres Almiray
024 * @since 2.0.0
025 */
026 public class TableViewAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TableViewListener {
027 private CallableWithArgs<Void> selectModeChanged;
028 private CallableWithArgs<Void> columnSourceChanged;
029 private CallableWithArgs<Void> rowEditorChanged;
030 private CallableWithArgs<Void> tableDataChanged;
031 private CallableWithArgs<Void> disabledRowFilterChanged;
032
033 public CallableWithArgs<Void> getSelectModeChanged() {
034 return this.selectModeChanged;
035 }
036
037 public CallableWithArgs<Void> getColumnSourceChanged() {
038 return this.columnSourceChanged;
039 }
040
041 public CallableWithArgs<Void> getRowEditorChanged() {
042 return this.rowEditorChanged;
043 }
044
045 public CallableWithArgs<Void> getTableDataChanged() {
046 return this.tableDataChanged;
047 }
048
049 public CallableWithArgs<Void> getDisabledRowFilterChanged() {
050 return this.disabledRowFilterChanged;
051 }
052
053
054 public void setSelectModeChanged(CallableWithArgs<Void> selectModeChanged) {
055 this.selectModeChanged = selectModeChanged;
056 }
057
058 public void setColumnSourceChanged(CallableWithArgs<Void> columnSourceChanged) {
059 this.columnSourceChanged = columnSourceChanged;
060 }
061
062 public void setRowEditorChanged(CallableWithArgs<Void> rowEditorChanged) {
063 this.rowEditorChanged = rowEditorChanged;
064 }
065
066 public void setTableDataChanged(CallableWithArgs<Void> tableDataChanged) {
067 this.tableDataChanged = tableDataChanged;
068 }
069
070 public void setDisabledRowFilterChanged(CallableWithArgs<Void> disabledRowFilterChanged) {
071 this.disabledRowFilterChanged = disabledRowFilterChanged;
072 }
073
074
075 public void selectModeChanged(org.apache.pivot.wtk.TableView arg0, org.apache.pivot.wtk.TableView.SelectMode arg1) {
076 if (selectModeChanged != null) {
077 selectModeChanged.call(arg0, arg1);
078 }
079 }
080
081 public void columnSourceChanged(org.apache.pivot.wtk.TableView arg0, org.apache.pivot.wtk.TableView arg1) {
082 if (columnSourceChanged != null) {
083 columnSourceChanged.call(arg0, arg1);
084 }
085 }
086
087 public void rowEditorChanged(org.apache.pivot.wtk.TableView arg0, org.apache.pivot.wtk.TableView.RowEditor arg1) {
088 if (rowEditorChanged != null) {
089 rowEditorChanged.call(arg0, arg1);
090 }
091 }
092
093 public void tableDataChanged(org.apache.pivot.wtk.TableView arg0, org.apache.pivot.collections.List<?> arg1) {
094 if (tableDataChanged != null) {
095 tableDataChanged.call(arg0, arg1);
096 }
097 }
098
099 public void disabledRowFilterChanged(org.apache.pivot.wtk.TableView arg0, org.apache.pivot.util.Filter<?> arg1) {
100 if (disabledRowFilterChanged != null) {
101 disabledRowFilterChanged.call(arg0, arg1);
102 }
103 }
104
105 }
|