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