TextInputAdapter.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 TextInputAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TextInputListener {
027     private CallableWithArgs<Void> textValidChanged;
028     private CallableWithArgs<Void> textSizeChanged;
029     private CallableWithArgs<Void> maximumLengthChanged;
030     private CallableWithArgs<Void> passwordChanged;
031     private CallableWithArgs<Void> promptChanged;
032     private CallableWithArgs<Void> textValidatorChanged;
033     private CallableWithArgs<Void> strictValidationChanged;
034     private CallableWithArgs<Void> editableChanged;
035 
036     public CallableWithArgs<Void> getTextValidChanged() {
037         return this.textValidChanged;
038     }
039 
040     public CallableWithArgs<Void> getTextSizeChanged() {
041         return this.textSizeChanged;
042     }
043 
044     public CallableWithArgs<Void> getMaximumLengthChanged() {
045         return this.maximumLengthChanged;
046     }
047 
048     public CallableWithArgs<Void> getPasswordChanged() {
049         return this.passwordChanged;
050     }
051 
052     public CallableWithArgs<Void> getPromptChanged() {
053         return this.promptChanged;
054     }
055 
056     public CallableWithArgs<Void> getTextValidatorChanged() {
057         return this.textValidatorChanged;
058     }
059 
060     public CallableWithArgs<Void> getStrictValidationChanged() {
061         return this.strictValidationChanged;
062     }
063 
064     public CallableWithArgs<Void> getEditableChanged() {
065         return this.editableChanged;
066     }
067 
068 
069     public void setTextValidChanged(CallableWithArgs<Void> textValidChanged) {
070         this.textValidChanged = textValidChanged;
071     }
072 
073     public void setTextSizeChanged(CallableWithArgs<Void> textSizeChanged) {
074         this.textSizeChanged = textSizeChanged;
075     }
076 
077     public void setMaximumLengthChanged(CallableWithArgs<Void> maximumLengthChanged) {
078         this.maximumLengthChanged = maximumLengthChanged;
079     }
080 
081     public void setPasswordChanged(CallableWithArgs<Void> passwordChanged) {
082         this.passwordChanged = passwordChanged;
083     }
084 
085     public void setPromptChanged(CallableWithArgs<Void> promptChanged) {
086         this.promptChanged = promptChanged;
087     }
088 
089     public void setTextValidatorChanged(CallableWithArgs<Void> textValidatorChanged) {
090         this.textValidatorChanged = textValidatorChanged;
091     }
092 
093     public void setStrictValidationChanged(CallableWithArgs<Void> strictValidationChanged) {
094         this.strictValidationChanged = strictValidationChanged;
095     }
096 
097     public void setEditableChanged(CallableWithArgs<Void> editableChanged) {
098         this.editableChanged = editableChanged;
099     }
100 
101 
102     public void textValidChanged(org.apache.pivot.wtk.TextInput arg0) {
103         if (textValidChanged != null) {
104             textValidChanged.call(arg0);
105         }
106     }
107 
108     public void textSizeChanged(org.apache.pivot.wtk.TextInput arg0, int arg1) {
109         if (textSizeChanged != null) {
110             textSizeChanged.call(arg0, arg1);
111         }
112     }
113 
114     public void maximumLengthChanged(org.apache.pivot.wtk.TextInput arg0, int arg1) {
115         if (maximumLengthChanged != null) {
116             maximumLengthChanged.call(arg0, arg1);
117         }
118     }
119 
120     public void passwordChanged(org.apache.pivot.wtk.TextInput arg0) {
121         if (passwordChanged != null) {
122             passwordChanged.call(arg0);
123         }
124     }
125 
126     public void promptChanged(org.apache.pivot.wtk.TextInput arg0, java.lang.String arg1) {
127         if (promptChanged != null) {
128             promptChanged.call(arg0, arg1);
129         }
130     }
131 
132     public void textValidatorChanged(org.apache.pivot.wtk.TextInput arg0, org.apache.pivot.wtk.validation.Validator arg1) {
133         if (textValidatorChanged != null) {
134             textValidatorChanged.call(arg0, arg1);
135         }
136     }
137 
138     public void strictValidationChanged(org.apache.pivot.wtk.TextInput arg0) {
139         if (strictValidationChanged != null) {
140             strictValidationChanged.call(arg0);
141         }
142     }
143 
144     public void editableChanged(org.apache.pivot.wtk.TextInput arg0) {
145         if (editableChanged != null) {
146             editableChanged.call(arg0);
147         }
148     }
149 
150 }