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
020 /**
021 * @author Andres Almiray
022 * @since 2.0.0
023 */
024 public class ButtonAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.ButtonListener {
025 private CallableWithArgs<Void> buttonDataChanged;
026 private CallableWithArgs<Void> dataRendererChanged;
027 private CallableWithArgs<Void> actionChanged;
028 private CallableWithArgs<Void> toggleButtonChanged;
029 private CallableWithArgs<Void> triStateChanged;
030 private CallableWithArgs<Void> buttonGroupChanged;
031
032 public CallableWithArgs<Void> getButtonDataChanged() {
033 return this.buttonDataChanged;
034 }
035
036 public CallableWithArgs<Void> getDataRendererChanged() {
037 return this.dataRendererChanged;
038 }
039
040 public CallableWithArgs<Void> getActionChanged() {
041 return this.actionChanged;
042 }
043
044 public CallableWithArgs<Void> getToggleButtonChanged() {
045 return this.toggleButtonChanged;
046 }
047
048 public CallableWithArgs<Void> getTriStateChanged() {
049 return this.triStateChanged;
050 }
051
052 public CallableWithArgs<Void> getButtonGroupChanged() {
053 return this.buttonGroupChanged;
054 }
055
056
057 public void setButtonDataChanged(CallableWithArgs<Void> buttonDataChanged) {
058 this.buttonDataChanged = buttonDataChanged;
059 }
060
061 public void setDataRendererChanged(CallableWithArgs<Void> dataRendererChanged) {
062 this.dataRendererChanged = dataRendererChanged;
063 }
064
065 public void setActionChanged(CallableWithArgs<Void> actionChanged) {
066 this.actionChanged = actionChanged;
067 }
068
069 public void setToggleButtonChanged(CallableWithArgs<Void> toggleButtonChanged) {
070 this.toggleButtonChanged = toggleButtonChanged;
071 }
072
073 public void setTriStateChanged(CallableWithArgs<Void> triStateChanged) {
074 this.triStateChanged = triStateChanged;
075 }
076
077 public void setButtonGroupChanged(CallableWithArgs<Void> buttonGroupChanged) {
078 this.buttonGroupChanged = buttonGroupChanged;
079 }
080
081
082 public void buttonDataChanged(org.apache.pivot.wtk.Button arg0, java.lang.Object arg1) {
083 if (buttonDataChanged != null) {
084 buttonDataChanged.call(arg0, arg1);
085 }
086 }
087
088 public void dataRendererChanged(org.apache.pivot.wtk.Button arg0, org.apache.pivot.wtk.Button.DataRenderer arg1) {
089 if (dataRendererChanged != null) {
090 dataRendererChanged.call(arg0, arg1);
091 }
092 }
093
094 public void actionChanged(org.apache.pivot.wtk.Button arg0, org.apache.pivot.wtk.Action arg1) {
095 if (actionChanged != null) {
096 actionChanged.call(arg0, arg1);
097 }
098 }
099
100 public void toggleButtonChanged(org.apache.pivot.wtk.Button arg0) {
101 if (toggleButtonChanged != null) {
102 toggleButtonChanged.call(arg0);
103 }
104 }
105
106 public void triStateChanged(org.apache.pivot.wtk.Button arg0) {
107 if (triStateChanged != null) {
108 triStateChanged.call(arg0);
109 }
110 }
111
112 public void buttonGroupChanged(org.apache.pivot.wtk.Button arg0, org.apache.pivot.wtk.ButtonGroup arg1) {
113 if (buttonGroupChanged != null) {
114 buttonGroupChanged.call(arg0, arg1);
115 }
116 }
117
118 }
|