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