flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s9tpep...@apache.org
Subject svn commit: r1237166 - in /incubator/flex/whiteboard/s9tpepper/validators: src-tests/org/apache/flex/validators/StringValidatorTests.as src/org/apache/flex/validators/StringValidator.as
Date Sat, 28 Jan 2012 21:15:04 GMT
Author: s9tpepper
Date: Sat Jan 28 21:15:04 2012
New Revision: 1237166

URL: http://svn.apache.org/viewvc?rev=1237166&view=rev
Log:
Fixed the runtime error when starting StringValidator making it usable without globalization
features.
-Added the expected globalization override/implementation methods under mx_internal. Not fully
implemented for globalization yet.

Modified:
    incubator/flex/whiteboard/s9tpepper/validators/src-tests/org/apache/flex/validators/StringValidatorTests.as
    incubator/flex/whiteboard/s9tpepper/validators/src/org/apache/flex/validators/StringValidator.as

Modified: incubator/flex/whiteboard/s9tpepper/validators/src-tests/org/apache/flex/validators/StringValidatorTests.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/s9tpepper/validators/src-tests/org/apache/flex/validators/StringValidatorTests.as?rev=1237166&r1=1237165&r2=1237166&view=diff
==============================================================================
--- incubator/flex/whiteboard/s9tpepper/validators/src-tests/org/apache/flex/validators/StringValidatorTests.as
(original)
+++ incubator/flex/whiteboard/s9tpepper/validators/src-tests/org/apache/flex/validators/StringValidatorTests.as
Sat Jan 28 21:15:04 2012
@@ -66,6 +66,22 @@ package org.apache.flex.validators
 		}
 
 		[Test]
+		public function StringValidator_onInstantiation_maxCharsIsNegativeOne():void
+		{
+			const stringValidator:StringValidator = new StringValidator();
+
+			assertEquals(-1, stringValidator.maxChars);
+		}
+
+		[Test]
+		public function StringValidator_onInstantiation_minCharsIsNegativeOne():void
+		{
+			const stringValidator:StringValidator = new StringValidator();
+
+			assertEquals(-1, stringValidator.minChars);
+		}
+
+		[Test]
 		public function validate_sourcePropertyIsLessThanMinChars_ValidationResultEventResultsAreNotNull():void
 		{
 			const stringValidator:StringValidator             = setUpMinCharsErrorValidation();

Modified: incubator/flex/whiteboard/s9tpepper/validators/src/org/apache/flex/validators/StringValidator.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/s9tpepper/validators/src/org/apache/flex/validators/StringValidator.as?rev=1237166&r1=1237165&r2=1237166&view=diff
==============================================================================
--- incubator/flex/whiteboard/s9tpepper/validators/src/org/apache/flex/validators/StringValidator.as
(original)
+++ incubator/flex/whiteboard/s9tpepper/validators/src/org/apache/flex/validators/StringValidator.as
Sat Jan 28 21:15:04 2012
@@ -1,16 +1,19 @@
 package org.apache.flex.validators
 {
+	import mx.core.mx_internal;
 	import mx.validators.ValidationResult;
 
 	import spark.validators.supportClasses.GlobalizationValidatorBase;
 
+	use namespace mx_internal;
+
 	public class StringValidator extends GlobalizationValidatorBase
 	{
 		public static var DEFAULT_MIN_CHARS_ERROR:String = "The string does not meet the minimum
character requirement.";
 		public static var DEFAULT_MAX_CHARS_ERROR:String = "The string exceeds the maximum character
requirement.";
 
-		private var _maxChars:int;
-		private var _minChars:int;
+		private var _maxChars:int                        = -1;
+		private var _minChars:int                        = -1;
 		private var _minCharsError:String                = DEFAULT_MIN_CHARS_ERROR;
 		private var _maxCharsError:String                = DEFAULT_MAX_CHARS_ERROR;
 
@@ -102,5 +105,18 @@ package org.apache.flex.validators
 		{
 			return new ValidationResult(true, "", "", minCharsError);
 		}
+
+		override mx_internal function createWorkingInstance():void
+		{
+		}
+
+		mx_internal function get g11nWorkingInstance():Object
+		{
+			return null;
+		}
+
+		mx_internal function set g11nWorkingInstance(sparkFormatter:Object):void
+		{
+		}
 	}
 }



Mime
View raw message