You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2018/09/07 07:11:51 UTC

[GitHub] alinakazi closed pull request #290: changes on 7-sep-2018

alinakazi closed pull request #290: changes on 7-sep-2018
URL: https://github.com/apache/royale-asjs/pull/290
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
index 4209bd6a3..8ee5b7eaa 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
+++ b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
@@ -151,6 +151,7 @@
 	<component id="RichTextEditor" class="mx.controls.RichTextEditor" />
         <component id="PanelTitleBar" class="mx.containers.PanelTitleBar" />
         <component id="MXAdvancedDataGridItemRenderer" class="mx.controls.advancedDataGridClasses.MXAdvancedDataGridItemRenderer"/>
+	<component id="PhoneFormatter" class="mx.formatters.PhoneFormatter"/>
 
 
     <component id="WipeLeft" class="mx.effects.WipeLeft" />
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 40c3861a6..84066761e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -147,6 +147,8 @@ internal class MXRoyaleClasses
 	import mx.net.FileFilter; FileFilter;
 	import mx.events.ProgressEvent; ProgressEvent;
 	import mx.controls.advancedDataGridClasses.MXAdvancedDataGridItemRenderer; MXAdvancedDataGridItemRenderer;
+	import mx.formatters.Formatter; Formatter;
+        import mx.formatters.IFormatter; IFormatter;
 	
 	COMPILE::JS
     	{
@@ -173,6 +175,7 @@ internal class MXRoyaleClasses
     
     import mx.controls.beads.models.SingleSelectionICollectionViewModel; SingleSelectionICollectionViewModel;
     import mx.controls.beads.models.SingleSelectionIListModel; SingleSelectionIListModel;
+    
 }
 
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/Formatter.as b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/Formatter.as
new file mode 100644
index 000000000..52a899c7e
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/Formatter.as
@@ -0,0 +1,402 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.formatters
+{
+
+import flash.events.Event;
+import mx.formatters.IFormatter;
+import mx.core.mx_internal;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+//import mx.resources.IResourceManager;
+//import mx.resources.ResourceManager;
+
+use namespace mx_internal;
+
+[ResourceBundle("formatters")]
+
+/**
+ *  The Formatter class is the base class for all data formatters.
+ *  Any subclass of Formatter must override the <code>format()</code> method.
+ *
+ *  @mxml
+ *
+ *  <p>The Formatter class defines the following tag attributes,
+ *  which all of its subclasses inherit:</p>
+ *  
+ *  <pre>
+ *  &lt;mx:<i>tagname</i>
+ *    <b>Properties</b>
+ *    error=""
+ *  /&gt;
+ *  </pre>
+ *  
+ *  @includeExample examples/SimpleFormatterExample.mxml
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class Formatter implements IFormatter 
+{
+    //include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class variables
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	//private static var initialized:Boolean = false;
+
+	/**
+	 *  @private
+	 *  Storage for the resourceManager getter.
+	 *  This gets initialized on first access,
+	 *  not at static initialization time, in order to ensure
+	 *  that the Singleton registry has already been initialized.
+	 */
+	//private static var _static_resourceManager:IResourceManager;
+	
+	/**
+	 *  @private
+     *  A reference to the object which manages
+     *  all of the application's localized resources.
+     *  This is a singleton instance which implements
+     *  the IResourceManager interface.
+	 */
+	/* private static function get static_resourceManager():IResourceManager
+	{
+		 if (!_static_resourceManager)
+			_static_resourceManager = ResourceManager.getInstance(); 
+
+		return _static_resourceManager; 
+	} */
+	
+	//--------------------------------------------------------------------------
+	//
+	//  Class properties
+	//
+	//--------------------------------------------------------------------------
+		
+	//----------------------------------
+	//  defaultInvalidFormatError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the defaultInvalidFormatError property.
+	 */
+	private static var _defaultInvalidFormatError:String
+	
+    /**
+	 *  @private
+	 */
+	private static var defaultInvalidFormatErrorOverride:String
+
+	/**
+	 *  Error message for an invalid format string specified to the formatter.
+	 *  The localeChain property of the ResourceManager is used to resolve
+	 *  the default error message. If it is unable to find a value, it will
+	 *  return <code>null</code>. This can happen if none of the locales
+	 *  specified in the localeChain are compiled into the application.
+	 * 
+	 *  @default "Invalid format"
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public static function get defaultInvalidFormatError():String
+	{
+		// initialize();
+
+		return _defaultInvalidFormatError; 
+	}
+
+	/**
+	 *  @private
+	 */
+	public static function set defaultInvalidFormatError(value:String):void
+	{
+		defaultInvalidFormatErrorOverride = value;
+		
+		/* _defaultInvalidFormatError = 
+			value != null ?
+			value :
+			static_resourceManager.getString(
+				"formatters", "defaultInvalidFormatError"); */
+	}
+
+	//----------------------------------
+	//  defaultInvalidValueError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the defaultInvalidValueError property.
+	 */
+	private static var _defaultInvalidValueError:String
+	
+    /**
+	 *  @private
+	 */
+	private static var defaultInvalidValueErrorOverride:String
+
+	/**
+	 *  Error messages for an invalid value specified to the formatter. The
+	 *  localeChain property of the ResourceManager is used to resolve the
+	 *  default error message. If it is unable to find a value, it will return
+	 *  <code>null</code>. This can happen if none of the locales specified in
+	 *  the localeChain are compiled into the application.
+	 * 
+	 *  @default "Invalid value"
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public static function get defaultInvalidValueError():String
+	{
+		// initialize();
+
+		return _defaultInvalidValueError; 
+	}
+
+	/**
+	 *  @private
+	 */
+	public static function set defaultInvalidValueError(value:String):void
+	{
+		defaultInvalidValueErrorOverride = value;
+
+		/* _defaultInvalidValueError =
+			value != null ?
+			value :
+			static_resourceManager.getString(
+				"formatters", "defaultInvalidValueError"); */
+	}
+	
+	//--------------------------------------------------------------------------
+	//
+	//  Class methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  @private    
+     */
+	private static function initialize():void
+	{
+		/* if (!initialized)
+		{ */
+			// Register as a weak listener for "change" events
+			// from ResourceManager.
+			/* static_resourceManager.addEventListener(
+				Event.CHANGE, static_resourceManager_changeHandler,
+				false, 0, true);
+
+			static_resourcesChanged();
+
+			initialized = true;
+		} */
+	}
+
+    /**
+	 *  @private    
+     */
+	private static function static_resourcesChanged():void
+	{
+		/* defaultInvalidFormatError = defaultInvalidFormatErrorOverride;
+		defaultInvalidValueError = defaultInvalidValueErrorOverride; */
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class event handlers
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private static function static_resourceManager_changeHandler(
+								event:Event):void
+	{
+		//static_resourcesChanged();
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function Formatter()
+	{
+		super();
+
+		// Register as a weak listener for "change" events from ResourceManager.
+		// If Formatters registered as a strong listener,
+		// they wouldn't get garbage collected.
+		/* resourceManager.addEventListener(
+			Event.CHANGE, resourceManager_changeHandler, false, 0, true);
+
+		resourcesChanged(); */
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  error
+	//----------------------------------
+
+    [Inspectable(category="General", defaultValue="null")]
+
+	/**
+	 *  Description saved by the formatter when an error occurs.
+	 *  For the possible values of this property,
+	 *  see the description of each formatter.
+	 *  <p>Subclasses must set this value
+	 *  in the <code>format()</code> method.</p>
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public var error:String;
+
+    //----------------------------------
+    //  resourceManager
+    //----------------------------------
+    
+    /**
+	 *  @private
+	 *  Storage for the resourceManager property.
+	 */
+	//private var _resourceManager:IResourceManager = ResourceManager.getInstance();
+    
+	/**
+	 *  @private
+	 *  This metadata suppresses a trace() in PropertyWatcher:
+	 *  "warning: unable to bind to property 'resourceManager' ..."
+	 */
+	[Bindable("unused")]
+	
+	/**
+	 *  @copy mx.core.UIComponent#resourceManager
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	/* protected function get resourceManager():IResourceManager
+    {
+    	return _resourceManager;
+    }
+     */
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  This method is called when a Formatter is constructed,
+	 *  and again whenever the ResourceManager dispatches
+	 *  a <code>"change"</code> Event to indicate
+	 *  that the localized resources have changed in some way.
+	 * 
+	 *  <p>This event will be dispatched when you set the ResourceManager's
+	 *  <code>localeChain</code> property, when a resource module
+	 *  has finished loading, and when you call the ResourceManager's
+	 *  <code>update()</code> method.</p>
+	 *
+	 *  <p>Subclasses should override this method and, after calling
+	 *  <code>super.resourcesChanged()</code>, do whatever is appropriate
+	 *  in response to having new resource values.</p>
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	protected function resourcesChanged():void
+	{
+	}
+
+	/**
+	 *  Formats a value and returns a String
+	 *  containing the new, formatted, value.
+	 *  All subclasses must override this method to implement the formatter.
+	 *
+	 *  @param value Value to be formatted.
+	 *
+	 *  @return The formatted string.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function format(value:Object):String
+	{
+		error = "This format function is abstract. " +
+			    "Subclasses must override it.";
+
+	    return "";
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Event handlers
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private function resourceManager_changeHandler(event:Event):void
+	{
+		//resourcesChanged();
+	}
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/IFormatter.as b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/IFormatter.as
new file mode 100644
index 000000000..b4a864d06
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/IFormatter.as
@@ -0,0 +1,58 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.formatters
+{
+
+/**
+ *  This interface specifies the method that a formatter object must implement
+ *  to allow it to be used as the formatter property for UI controls such as
+ *  the <code>AdvancedDataGridColumn</code>.
+ *
+ *  @see mx.controls.advancedDataGridClasses#formatter
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+*/
+public interface IFormatter
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Formats a value and returns a <code>String</code>
+     *  containing the new formatted value.
+     *
+     *  @param value Value to be formatted.
+     *
+     *  @return The formatted string.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    function format(value:Object):String;
+}
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/PhoneFormatter.as b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/PhoneFormatter.as
new file mode 100644
index 000000000..06b506c79
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/PhoneFormatter.as
@@ -0,0 +1,401 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.formatters
+{
+
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+
+[ResourceBundle("formatters")]
+
+/**
+ *  The PhoneFormatter class formats a valid number into a phone number format,
+ *  including international configurations.
+ *
+ *  <p>A shortcut is provided for the United States seven-digit format.
+ *  If the <code>areaCode</code> property contains a value
+ *  and you use the seven-digit format string, (###-####),
+ *  a seven-digit value to format automatically adds the area code
+ *  to the returned String.
+ *  The default format for the area code is (###). 
+ *  You can change this using the <code>areaCodeFormat</code> property. 
+ *  You can format the area code any way you want as long as it contains 
+ *  three number placeholders.</p>
+ *
+ *  <p>If an error occurs, an empty String is returned and a String
+ *  that describes the error is saved to the <code>error</code> property.
+ *  The <code>error</code> property can have one of the following values:</p>
+ *
+ *  <ul>
+ *    <li><code>"Invalid value"</code> means an invalid numeric value is passed 
+ *    to the <code>format()</code> method. The value should be a valid number 
+ *    in the form of a Number or a String, or the value contains a different 
+ *    number of digits than what is specified in the format String.</li>
+ *    <li> <code>"Invalid format"</code> means any of the characters in the 
+ *    <code>formatString</code> property do not match the allowed characters 
+ *    specified in the <code>validPatternChars</code> property, 
+ *    or the <code>areaCodeFormat</code> property is specified but does not
+ *    contain exactly three numeric placeholders.</li>
+ *  </ul>
+ *  
+ *  @mxml
+ *  
+ *  <p>The <code>&lt;mx:PhoneFormatter&gt;</code> tag
+ *  inherits all of the tag attributes of its superclass,
+ *  and adds the following tag attributes:</p>
+ *  
+ *  <pre>
+ *  &lt;mx:PhoneFormatter
+ *    areaCode="-1"
+ *    areaCodeFormat="(###)"
+ *    formatString="(###) ###-####"
+ *    validPatternChars="+()#-. "
+ *  />
+ *  </pre>
+ *  
+ *  @includeExample examples/PhoneFormatterExample.mxml
+ *  
+ *  @see mx.formatters.SwitchSymbolFormatter
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class PhoneFormatter extends Formatter
+{
+    //include "../core/Version.as";
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function PhoneFormatter()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  areaCode
+    //----------------------------------
+    
+    /**
+	 *  @private
+	 *  Storage for the areaCode property.
+	 */
+	private var _areaCode:Object;
+	
+    /**
+	 *  @private
+	 */
+	private var areaCodeOverride:Object;
+	
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Area code number added to a seven-digit United States
+     *  format phone number to form a 10-digit phone number.
+     *  A value of <code>-1</code> means do not  
+     *  prepend the area code.
+     *
+     *  @default -1  
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	public function get areaCode():Object
+	{
+		return _areaCode;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set areaCode(value:Object):void
+	{
+		areaCodeOverride = value;
+
+		/* _areaCode = value != null ?
+					int(value) :
+					resourceManager.getInt(
+						"formatters", "areaCode"); */
+	}
+
+    //----------------------------------
+    //  areaCodeFormat
+    //----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the areaCodeFormat property.
+	 */
+	private var _areaCodeFormat:String;
+	
+    /**
+	 *  @private
+	 */
+	private var areaCodeFormatOverride:String;
+	
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Default format for the area code when the <code>areacode</code>
+     *  property is rendered by a seven-digit format.
+     *
+     *  @default "(###) "
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	public function get areaCodeFormat():String
+	{
+		return _areaCodeFormat;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set areaCodeFormat(value:String):void
+	{
+		areaCodeFormatOverride = value;
+
+		/* _areaCodeFormat = value != null ?
+						  value :
+						  resourceManager.getString(
+						      "formatters", "areaCodeFormat"); */
+	}
+
+    //----------------------------------
+    //  formatString
+    //----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the formatString property.
+	 */
+	private var _formatString:String;
+	
+    /**
+	 *  @private
+	 */
+	private var formatStringOverride:String;
+	
+    [Inspectable(category="General", defaultValue="null")]
+    
+    /**
+     *  String that contains mask characters
+     *  that represent a specified phone number format.
+     *
+     *  @default "(###) ###-####"
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	public function get formatString():String
+	{
+		return _formatString;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set formatString(value:String):void
+	{
+		formatStringOverride = value;
+
+		/* _formatString = value != null ?
+						value :
+						resourceManager.getString(
+							"formatters", "phoneNumberFormat"); */
+	}
+
+    //----------------------------------
+    //  validPatternChars
+    //----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the validPatternChars property.
+	 */
+	private var _validPatternChars:String;
+	
+    /**
+	 *  @private
+	 */
+	private var validPatternCharsOverride:String;
+	
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  List of valid characters that can be used
+     *  in the <code>formatString</code> property.
+     *  This property is used during validation
+     *  of the <code>formatString</code> property.
+     *
+     *  @default "+()#- ."
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	public function get validPatternChars():String
+	{
+		return _validPatternChars;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set validPatternChars(value:String):void
+	{
+		validPatternCharsOverride = value;
+
+		/* _validPatternChars = value != null ?
+							 value :
+							 resourceManager.getString(
+							     "formatters", "validPatternChars"); */
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  @private    
+     */
+    /* override protected function resourcesChanged():void
+    {
+		super.resourcesChanged();
+
+        areaCode = areaCodeOverride;
+        areaCodeFormat = areaCodeFormatOverride;
+        formatString = formatStringOverride;
+        validPatternChars = validPatternCharsOverride;
+    } */
+
+    /**
+     *  Formats the String as a phone number.
+     *  If the value cannot be formatted, return an empty String 
+     *  and write a description of the error to the <code>error</code> property.
+     *
+     *  @param value Value to format.
+     *
+     *  @return Formatted String. Empty if an error occurs. A description 
+     *  of the error condition is written to the <code>error</code> property.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    /* override public function format(value:Object):String
+    {
+        // Reset any previous errors.
+        if (error)
+            error = null;
+
+        // --value--
+
+        if (!value || String(value).length == 0 || isNaN(Number(value)))
+        {
+            error = defaultInvalidValueError;
+            return "";
+        }
+
+        // --length--
+
+        var fStrLen:int = 0;
+        var letter:String;
+        var n:int;
+        var i:int;
+        
+        n = formatString.length;
+        for (i = 0; i < n; i++)
+        {
+            letter = formatString.charAt(i);
+            if (letter == "#")
+            {
+                fStrLen++;
+            }
+            else if (validPatternChars.indexOf(letter) == -1)
+            {
+                error = defaultInvalidFormatError;
+                return "";
+            }
+        }
+ */
+        /* if (String(value).length != fStrLen)
+        {
+            error = defaultInvalidValueError;
+            return "";
+        }
+
+        // --format--
+
+        var fStr:String = formatString;
+
+        if (fStrLen == 7 && areaCode != -1)
+        {
+            var aCodeLen:int = 0;
+            n = areaCodeFormat.length;
+            for (i = 0; i < n; i++)
+            {
+                if (areaCodeFormat.charAt(i) == "#")
+                    aCodeLen++;
+            }
+            if (aCodeLen == 3 && String(areaCode).length == 3)
+            {
+                fStr = String(areaCodeFormat).concat(fStr);
+                value = String(areaCode).concat(value);
+            }
+        } */
+
+       /*  var dataFormatter:SwitchSymbolFormatter = new SwitchSymbolFormatter();
+
+        return dataFormatter.formatValue(fStr, value); */
+    //}
+}
+
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services