You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2018/03/05 20:52:56 UTC

git commit: [flex-sdk] [refs/heads/develop] - Make restrictToMaskPattern and updatePrompt protected to allow overriding

Repository: flex-sdk
Updated Branches:
  refs/heads/develop c23af10fd -> 9a92a0882


Make restrictToMaskPattern and updatePrompt protected to allow overriding


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/9a92a088
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/9a92a088
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/9a92a088

Branch: refs/heads/develop
Commit: 9a92a08823f8f58f6d9ffa329cd6d373c9938945
Parents: c23af10
Author: Piotr Zarzycki <pi...@gmail.com>
Authored: Mon Mar 5 21:49:13 2018 +0100
Committer: Piotr Zarzycki <pi...@gmail.com>
Committed: Mon Mar 5 21:50:26 2018 +0100

----------------------------------------------------------------------
 .../src/spark/components/MaskedTextInput.as     | 50 +++++++++-----------
 1 file changed, 23 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/9a92a088/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as b/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
index c7eb0c9..21bfdfb 100644
--- a/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
+++ b/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
@@ -498,14 +498,32 @@ package spark.components {
             }
         }
 
-        //----------------------------------
-        //  PRIVATE
-        //----------------------------------
-
+        /**
+         * Manage template rules:
+         *      # - numeric-only,
+         *      @ - alphabetic-only,
+         *      ? - any
+         * @param inputChar
+         * @param position
+         * @return the restricted character or the mask character
+         */
+        protected function restrictToMaskPattern(inputChar:String, position:int):String {
+            var maskChar:String = getMaskCharAt(position);
+            switch (maskChar) {
+                case "#":
+                    return StringUtil.restrict(inputChar, "0-9");
+                case "@":
+                    return StringUtil.restrict(inputChar, "a-zA-Z");
+                case "?":
+                    return inputChar;
+            }
+            return maskChar;
+        }
+		
         /**
          * update prompt
          */
-        private function updatePrompt():void {
+        protected function updatePrompt():void {
             var _prompt:String = "";
             var textLength:int = super.text.length;
             for (var i:int = 0; i < textLength; i++) {
@@ -526,28 +544,6 @@ package spark.components {
             prompt = _prompt;
         }
 
-        /**
-         * Manage template rules:
-         *      # - numeric-only,
-         *      @ - alphabetic-only,
-         *      ? - any
-         * @param inputChar
-         * @param position
-         * @return the restricted character or the mask character
-         */
-        private function restrictToMaskPattern(inputChar:String, position:int):String {
-            var maskChar:String = getMaskCharAt(position);
-            switch (maskChar) {
-                case "#":
-                    return StringUtil.restrict(inputChar, "0-9");
-                case "@":
-                    return StringUtil.restrict(inputChar, "a-zA-Z");
-                case "?":
-                    return inputChar;
-            }
-            return maskChar;
-        }
-
 
         //----------------------------------
         //  PRIVATE AUTOMATA'S LOGIC