incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject svn commit: r1376073 [4/4] - in /incubator/flex/utilities/trunk: common/src/assets/images/ common/src/org/ common/src/org/apache/ common/src/org/apache/flex/ common/src/org/apache/flex/utilities/ common/src/org/apache/flex/utilities/common/ common/src/...
Date Wed, 22 Aug 2012 14:35:33 GMT
Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as (original)
+++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/resource/ViewResourceConstants.as Wed Aug 22 14:35:32 2012
@@ -19,653 +19,203 @@
 
 package org.apache.flex.packageflexsdk.resource
 {
-	import flash.events.Event;
-	import flash.utils.getQualifiedClassName;
+
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+import flash.utils.Dictionary;
+import flash.utils.Proxy;
+import flash.utils.flash_proxy;
+
+import mx.collections.ArrayCollection;
+import mx.events.PropertyChangeEvent;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+
+[Bindable(event="propertyChange")]
+public dynamic class ViewResourceConstants extends Proxy implements IEventDispatcher
+{
+	
+	//--------------------------------------------------------------------------
+	//
+	//    Class constants
+	//
+	//--------------------------------------------------------------------------
+	
+	public static const BUNDLE_NAME:String = "resourceStrings";
 	
-	import mx.resources.IResourceManager;
-	import mx.resources.ResourceManager;
+	public static const DEFAULT_LANGUAGE:String = RuntimeLocale.EN_US;
 	
-	public final class ViewResourceConstants
+	//--------------------------------------------------------------------------
+	//
+	//    Class properties
+	//
+	//--------------------------------------------------------------------------
+	
+	//----------------------------------
+	//    instance
+	//----------------------------------
+	
+	private static var _instance:ViewResourceConstants;
+	
+	public static function get instance():ViewResourceConstants
 	{
-		public static const URL_APACHE_FLEX:String = "http://incubator.apache.org/flex/";
-		public static const URL_CONFIG_XML:String = "http://people.apache.org/~bigosmallm/installapacheflex/ApacheFlexConfig.xml";
-		/*
-			I'm not entirely sure (as IANAL), but on http://www.hostip.info/faq.html
-			I see this: "Hostip.info is an open project ... contributed by the 
-			community as part of an ongoing open-source effort." Not a license 
-			per se, but I guess it'll have to do :-)
-		*/
-		public static const URL_FETCH_GEO_IP:String = "http://api.hostip.info/country.php";
-		public static const URL_FETCH_MIRROR_LIST:String = "http://www.apache.org/mirrors/mirrors.list";
-		public static const URL_FETCH_MIRROR_CGI:String = "http://incubator.apache.org/flex/single-mirror-url.cgi";
-		
-		private static var _instance:ViewResourceConstants;
-
-		private var _STEP_VERIFY_FLEX_SDK:String;
-		
-		private var _ERROR_VERIFY_FLEX_SDK:String;
-		private var _ERROR_MIRROR_FETCH:String;
-		
-		private var _FETCH_GEO_IP:String;
-		private var _FETCH_GEO_IP_DONE:String;
-		private var _FETCH_GEO_IP_ERROR:String;
-		private var _FETCH_MIRROR_CGI:String;
-		private var _FETCH_MIRROR_CGI_DONE:String;
-		private var _FETCH_MIRROR_CGI_ERROR:String;
-		private var _FETCH_MIRROR_LIST:String;
-		private var _FETCH_MIRROR_LIST_DONE:String;
-		private var _FETCH_MIRROR_LIST_PARSED:String;
-		
-		private var _INFO_VERIFY_FLEX_SDK_DONE:String;
-		
-		//Labels
-		private var _INSTALL_BTN_LABEL:String;
-		private var _SELECT_PATH_PROMPT:String;
-		private var _BROWSE_BTN_LABEL:String;
-		private var _INSTALL_LOG_BTN_LABEL:String;
-		private var _CLOSE_BTN_LABEL:String;
-		private var _NEXT_BTN_LABEL:String;
-		private var _MPL_LICENSE_BTN_LABEL:String;
-		private var _ADOBE_LICENSE_BTN_LABEL:String;
-		private var _OPEN_APACHE_FLEX_FOLDER_BTN_LABEL:String;
-
-		//Log messages
-		private var _ERROR_CONFIG_XML_LOAD:String;
-		private var _ERROR_INVALID_SDK_URL:String;
-		private var _ERROR_INVALID_AIR_SDK_URL_WINDOWS:String;
-		private var _ERROR_INVALID_AIR_SDK_URL_MAC:String;
-		private var _ERROR_INVALID_FLASH_PLAYER_SWC_URL:String;
-		private var _ERROR_UNSUPPORTED_OPERATING_SYSTEM:String;
-		private var _INFO_APP_INVOKED:String;
-		private var _INFO_ENTER_VALID_FLEX_SDK_PATH:String;
-		private var _INFO_INVOKED_GUI_MODE:String;
-		private var _INFO_SELECT_DIRECTORY:String;
-		private var _INFO_CREATING_FLEX_HOME:String;
-		private var _INFO_CREATING_TEMP_DIR:String;
-		private var _INFO_DOWNLOADING_APACHE_FLEX_SDK:String;
-		private var _INFO_UNZIPPING:String;
-		private var _INFO_FINISHED_UNZIPPING:String;
-		private var _INFO_DOWLOADING_AIR_RUNTIME_KIT_WINDOWS:String;
-		private var _INFO_DOWLOADING_AIR_RUNTIME_KIT_MAC:String;
-		private var _ERROR_NATIVE_PROCESS_NOT_SUPPORTED:String;
-		private var _ERROR_NATIVE_PROCESS_ERROR:String;
-		private var _INFO_FINISHED_UNTARING:String;
-		private var _INFO_INSTALLING_PLAYERGLOBAL_SWC:String;
-		private var _INFO_INSTALLING_CONFIG_FILES:String;
-		private var _INFO_INSTALLATION_COMPLETE:String;
-		private var _ERROR_UNABLE_TO_COPY_FILE:String;
-		private var _INFO_DOWNLOADED:String;
-		private var _ERROR_UNABLE_TO_DOWNLOAD_FLEX_SDK:String;
-		private var _ERROR_UNABLE_TO_DOWNLOAD_AIR_SDK:String;
-		private var _ERROR_UNABLE_TO_DOWNLOAD_FLASH_PLAYER_SWC:String;
-		private var _INFO_ABORT_INSTALLATION:String;
-		private var _ERROR_UNABLE_TO_DELETE_TEMP_DIRECTORY:String;
-		private var _ERROR_UNABLE_TO_CREATE_TEMP_DIRECTORY:String;
-		private var _ERROR_INVALID_FLEX_SDK_DIRECTORY:String;
-		private var _ERROR_UNABLE_TO_INSTALL_CONFIG_FILES:String;
-		private var _INFO_DOWNLOADING_ADOBE_FLEX_SDK:String;
-		private var _ERROR_UNABLE_TO_DOWNLOAD_FILE:String;
-		private var _ERROR_UNABLE_TO_UNZIP:String;
-		private var _INFO_DOWNLOADING_FILE_FROM:String;
-		private var _INFO_NEED_TO_READ_AND_AGREE_TO_LICENSE:String;
-		private var _INFO_INSTALLING:String;
-		private var _ERROR_DIRECTORY_NOT_EMPTY:String;
-		
-		//URLs
-		private var _APACHE_FLEX_URL:String;
-		private var _CONFIG_URL:String;
-		
-		//STEPS
-		private var _STEP_CREATE_DIRECTORIES:String;
-		private var _STEP_DOWNLOAD_FLEX_SDK:String;
-		private var _STEP_UNZIP_FLEX_SDK:String;
-		private var _STEP_DOWNLOAD_AIR_RUNTIME_KIT:String;
-		private var _STEP_UNZIP_AIR_RUNTIME_KIT:String;
-		private var _STEP_DOWNLOAD_FLASHPLAYER_SWC:String;
-		private var _STEP_INSTALL_CONFIG_FILES:String;
-		private var _STEP_OPTIONAL_INSTALL_FONTSWF:String;
-		private var _STEP_OPTIONAL_INSTALL_BLAZEDS:String;
-		private var _STEP_OPTIONAL_INSTALL_TLF:String;
-		private var _STEP_OPTIONAL_INSTALL_OSMF:String;
-		
-		//PROMPTS
-		private var _ASK_OSMF:String;
-		private var _ASK_BLAZEDS:String;
-		private var _ASK_TLF:String;
-		private var _ASK_FONTSWF:String;
-		private var _INSTALL:String;
-		private var _DONT_INSTALL:String;
+		if (!_instance)
+			_instance = new ViewResourceConstants(new SE());
 		
+		return _instance;
+	}
+	
+	//----------------------------------
+	//    supportedLanguages
+	//----------------------------------
+	
+	public static function get supportedLanguages():ArrayCollection
+	{
+		var result:ArrayCollection = new ArrayCollection();
 		
-		private var _iResourceManager:IResourceManager;
+		result.addItem({label: "English (US)", data: RuntimeLocale.EN_US});
+		result.addItem({label: "English (GB)", data: RuntimeLocale.EN_GB});
+		result.addItem({label: "English (AU)", data: RuntimeLocale.EN_AU});
+		result.addItem({label: "Nederlands", data: RuntimeLocale.NL_NL});
+		result.addItem({label: "Greek", data: RuntimeLocale.EL_GR});
 		
-		public function ViewResourceConstants(enforcer:SingletonEnforcer)
-		{
-			if (enforcer != null && !(enforcer is SingletonEnforcer))
-			{
-				throw new Error( "Invalid Singleton access. Please use ViewResourceManager.getInstance() instead." );
-			}
-			
-			_iResourceManager = ResourceManager.getInstance();
-			_iResourceManager.addEventListener(Event.CHANGE , resourceLocale_Handler);
-			populateStrings();
-		}
-		
-		public static function getInstance():ViewResourceConstants
-		{
-			if (_instance == null)
-			{
-				_instance = new ViewResourceConstants(new SingletonEnforcer());	
-			}
-			
-			return _instance;
-		}
+		return result;
+	}
+	
+	//--------------------------------------------------------------------------
+	//
+	//    Constructor
+	//
+	//--------------------------------------------------------------------------
+	
+	public function ViewResourceConstants(se:SE) 
+	{
+		_eventDispatcher = new EventDispatcher();
 		
-		protected function resourceLocale_Handler(event:Event):void
-		{
-			populateStrings();
-		}
+		RuntimeLocale.instance.installResources();
+	}
 		
-		private function populateStrings():void
+	//--------------------------------------------------------------------------
+	//
+	//    Variables
+	//
+	//--------------------------------------------------------------------------
+	
+	private var _content:Dictionary;
+	
+	private var _eventDispatcher:EventDispatcher;
+	
+	private var _resourceManager:IResourceManager = ResourceManager.getInstance();;
+	
+	//--------------------------------------------------------------------------
+	//
+	//    Methods
+	//
+	//--------------------------------------------------------------------------
+	
+	//----------------------------------
+	//    addEventListener
+	//----------------------------------
+	
+	public function addEventListener(type:String, listener:Function, 
+									 useCapture:Boolean = false, priority:int = 0, 
+									 useWeakReference:Boolean = false):void
+	{
+		_eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
+	}
+	
+	//----------------------------------
+	//    dispatchEvent
+	//----------------------------------
+	
+	public function dispatchEvent(event:Event):Boolean
+	{
+		return _eventDispatcher.dispatchEvent(event);
+	}
+	
+	//----------------------------------
+	//    getProperty
+	//----------------------------------
+	
+	override flash_proxy function getProperty(name:*):*
+	{
+		if (!_content[name])
 		{
-			_ERROR_VERIFY_FLEX_SDK = _iResourceManager.getString("messagestrings","ERROR_VERIFY_FLEX_SDK");
-			_ERROR_MIRROR_FETCH = _iResourceManager.getString("messagestrings","ERROR_MIRROR_FETCH");
-			
-			_FETCH_GEO_IP = _iResourceManager.getString("messagestrings","FETCH_GEO_IP");
-			_FETCH_GEO_IP_DONE = _iResourceManager.getString("messagestrings","FETCH_GEO_IP_DONE");
-			_FETCH_GEO_IP_ERROR = _iResourceManager.getString("messagestrings","FETCH_GEO_IP_ERROR");
-			_FETCH_MIRROR_CGI = _iResourceManager.getString("messagestrings","FETCH_MIRROR_CGI");
-			_FETCH_MIRROR_CGI_DONE = _iResourceManager.getString("messagestrings","FETCH_MIRROR_CGI_DONE");
-			_FETCH_MIRROR_CGI_ERROR = _iResourceManager.getString("messagestrings","FETCH_MIRROR_CGI_ERROR");
-			_FETCH_MIRROR_LIST = _iResourceManager.getString("messagestrings","FETCH_MIRROR_LIST");
-			_FETCH_MIRROR_LIST_DONE = _iResourceManager.getString("messagestrings","FETCH_MIRROR_LIST_DONE");
-			_FETCH_MIRROR_LIST_PARSED = _iResourceManager.getString("messagestrings","FETCH_MIRROR_LIST_PARSED");
-			
-			_INFO_VERIFY_FLEX_SDK_DONE = _iResourceManager.getString("messagestrings","INFO_VERIFY_FLEX_SDK_DONE");
-			
-			_STEP_VERIFY_FLEX_SDK = _iResourceManager.getString("messagestrings","STEP_VERIFY_FLEX_SDK");
+			var errorString:String = "The key was not found in the resource strings (key: '" + name + "').";
 			
-			_INSTALL_BTN_LABEL = _iResourceManager.getString("messagestrings","install_btn_label");
-			_SELECT_PATH_PROMPT = _iResourceManager.getString("messagestrings","select_path_prompt");
-			_BROWSE_BTN_LABEL = _iResourceManager.getString("messagestrings","browse_btn_label");
-			_INSTALL_LOG_BTN_LABEL = _iResourceManager.getString("messagestrings","install_log_btn_label");
-			_CLOSE_BTN_LABEL = _iResourceManager.getString("messagestrings","close_btn_label");
-			_NEXT_BTN_LABEL = ResourceManager.getInstance().getString("messagestrings","next_btn_label");
-			_MPL_LICENSE_BTN_LABEL = ResourceManager.getInstance().getString("messagestrings","show_mpl_license_btn_label");
-			_ADOBE_LICENSE_BTN_LABEL = ResourceManager.getInstance().getString("messagestrings","show_adobe_license_btn_label");
-			_OPEN_APACHE_FLEX_FOLDER_BTN_LABEL = ResourceManager.getInstance().getString("messagestrings","open_apache_flex_folder_btn_label");
+			trace(errorString);
 			
-			_APACHE_FLEX_URL = _iResourceManager.getString("messagestrings","apache_flex_url");
-			_CONFIG_URL = _iResourceManager.getString("messagestrings","config_url");
-
-			_ERROR_CONFIG_XML_LOAD = _iResourceManager.getString("messagestrings","error_config_xml_load");
-			_ERROR_INVALID_SDK_URL = _iResourceManager.getString("messagestrings","error_invalid_sdk_url");
-			_ERROR_INVALID_AIR_SDK_URL_WINDOWS = _iResourceManager.getString("messagestrings","error_invalid_air_sdk_url_windows");
-			_ERROR_INVALID_AIR_SDK_URL_MAC = _iResourceManager.getString("messagestrings","error_invalid_air_sdk_url_mac");
-			_ERROR_INVALID_FLASH_PLAYER_SWC_URL = _iResourceManager.getString("messagestrings","error_invalid_flash_player_swc_url"); 
-			_INFO_APP_INVOKED = _iResourceManager.getString("messagestrings","info_app_invoked");
-			_ERROR_UNSUPPORTED_OPERATING_SYSTEM = _iResourceManager.getString("messagestrings","error_unsupported_operating_system");
-			_INFO_ENTER_VALID_FLEX_SDK_PATH = _iResourceManager.getString("messagestrings","info_enter_valid_flex_sdk_path");
-			_INFO_INVOKED_GUI_MODE = _iResourceManager.getString("messagestrings","info_invoked_gui_mode");
-			_INFO_SELECT_DIRECTORY = _iResourceManager.getString("messagestrings","info_select_directory");
-			_INFO_CREATING_FLEX_HOME = _iResourceManager.getString("messagestrings","info_creating_flex_home");
-			_INFO_CREATING_TEMP_DIR = _iResourceManager.getString("messagestrings","info_creating_temp_dir");
-			_INFO_DOWNLOADING_APACHE_FLEX_SDK = _iResourceManager.getString("messagestrings","info_dowloading_flex_sdk");
-			_INFO_UNZIPPING = _iResourceManager.getString("messagestrings","info_unzipping");
-			_INFO_FINISHED_UNZIPPING = _iResourceManager.getString("messagestrings","info_unzipping");
-			_INFO_DOWLOADING_AIR_RUNTIME_KIT_WINDOWS = _iResourceManager.getString("messagestrings","info_dowloading_air_runtime_kit_windows");
-			_INFO_DOWLOADING_AIR_RUNTIME_KIT_MAC = _iResourceManager.getString("messagestrings","info_dowloading_air_runtime_kit_mac");
-			_ERROR_NATIVE_PROCESS_NOT_SUPPORTED = _iResourceManager.getString("messagestrings","error_native_process_not_supported");
-			_ERROR_NATIVE_PROCESS_ERROR = _iResourceManager.getString("messagestrings","error_native_process_error");
-			_INFO_FINISHED_UNTARING = _iResourceManager.getString("messagestrings","info_finished_untaring");
-			_INFO_INSTALLING_PLAYERGLOBAL_SWC = _iResourceManager.getString("messagestrings","info_installing_playerglobal_swc");
-			_INFO_INSTALLING_CONFIG_FILES = _iResourceManager.getString("messagestrings","info_installing_config_files");
-			_INFO_INSTALLATION_COMPLETE = _iResourceManager.getString("messagestrings","info_installation_complete");
-			_ERROR_UNABLE_TO_COPY_FILE = _iResourceManager.getString("messagestrings","error_unable_to_copy_file");
-			_INFO_DOWNLOADED = _iResourceManager.getString("messagestrings","info_downloaded");
-			_ERROR_UNABLE_TO_DOWNLOAD_FLEX_SDK = _iResourceManager.getString("messagestrings","error_unable_to_download_flex_sdk");
-			_ERROR_UNABLE_TO_DOWNLOAD_AIR_SDK = _iResourceManager.getString("messagestrings","error_unable_to_download_air_sdk");
-			_ERROR_UNABLE_TO_DOWNLOAD_FLASH_PLAYER_SWC = _iResourceManager.getString("messagestrings","error_unable_to_download_flash_player_swc");
-			_INFO_ABORT_INSTALLATION = _iResourceManager.getString("messagestrings","info_abort_installation");
-			_ERROR_UNABLE_TO_DELETE_TEMP_DIRECTORY = _iResourceManager.getString("messagestrings","error_unable_to_delete_temp_directory");
-			_ERROR_UNABLE_TO_CREATE_TEMP_DIRECTORY = _iResourceManager.getString("messagestrings","error_unable_to_create_temp_directory");
-			_ERROR_INVALID_FLEX_SDK_DIRECTORY = _iResourceManager.getString("messagestrings","error_invalid_flex_sdk_directory");
-			_ERROR_UNABLE_TO_INSTALL_CONFIG_FILES = _iResourceManager.getString("messagestrings","error_unable_to_install_config_files");
-			_INFO_DOWNLOADING_FILE_FROM = _iResourceManager.getString("messagestrings","info_dowloading_file_from");
-			_ERROR_UNABLE_TO_DOWNLOAD_FILE = _iResourceManager.getString("messagestrings","error_unable_to_download_file");
-			_ERROR_UNABLE_TO_UNZIP = _iResourceManager.getString("messagestrings","error_unable_to_unzip");
-			_INFO_NEED_TO_READ_AND_AGREE_TO_LICENSE = _iResourceManager.getString("messagestrings","info_need_to_read_and_agree_to_license");
-			_INFO_INSTALLING = _iResourceManager.getString("messagestrings","info_installing");
-			_ERROR_DIRECTORY_NOT_EMPTY = _iResourceManager.getString("messagestrings","error_dir_not_empty");
-			
-			_STEP_CREATE_DIRECTORIES = _iResourceManager.getString("messagestrings","step_create_directories");
-			_STEP_DOWNLOAD_FLEX_SDK = _iResourceManager.getString("messagestrings","step_download_flex_sdk");
-			_STEP_UNZIP_FLEX_SDK = _iResourceManager.getString("messagestrings","step_unzip_flex_sdk");
-			_STEP_DOWNLOAD_AIR_RUNTIME_KIT = _iResourceManager.getString("messagestrings","step_download_air_runtime_kit");
-			_STEP_UNZIP_AIR_RUNTIME_KIT = _iResourceManager.getString("messagestrings","step_unzip_air_runtime_kit");
-			_STEP_DOWNLOAD_FLASHPLAYER_SWC = _iResourceManager.getString("messagestrings","step_download_flashplayer_swc");
-			_STEP_INSTALL_CONFIG_FILES = _iResourceManager.getString("messagestrings","step_install_config_files");
-			_STEP_OPTIONAL_INSTALL_FONTSWF = _iResourceManager.getString("messagestrings","step_optional_install_FontSwf");
-			_STEP_OPTIONAL_INSTALL_BLAZEDS = _iResourceManager.getString("messagestrings","step_optional_install_BlazeDS");
-			_STEP_OPTIONAL_INSTALL_TLF = _iResourceManager.getString("messagestrings","step_optional_install_TLF");
-			_STEP_OPTIONAL_INSTALL_OSMF = _iResourceManager.getString("messagestrings","step_optional_install_OSMF");
-			
-			_ASK_BLAZEDS = _iResourceManager.getString("messagestrings","ask_blazeds");
-			_ASK_FONTSWF = _iResourceManager.getString("messagestrings","ask_fontswf");
-			_ASK_OSMF = _iResourceManager.getString("messagestrings","ask_osmf");
-			_ASK_TLF = _iResourceManager.getString("messagestrings","ask_tlf");
-			_INSTALL = _iResourceManager.getString("messagestrings","install");
-			_DONT_INSTALL = _iResourceManager.getString("messagestrings","dont_install");
-			
-		}
-		
-		public function get STEP_VERIFY_FLEX_SDK():String
-		{
-			return _STEP_VERIFY_FLEX_SDK;
-		}
-		
-		public function get ERROR_VERIFY_FLEX_SDK():String
-		{
-			return _ERROR_VERIFY_FLEX_SDK;
+			throw new Error(errorString);
 		}
 		
-		public function get ERROR_MIRROR_FETCH():String
-		{
-			return _ERROR_MIRROR_FETCH;
-		}
-		
-		public function get FETCH_GEO_IP():String
-		{
-			return _FETCH_GEO_IP;
-		}
-		
-		public function get FETCH_GEO_IP_DONE():String
-		{
-			return _FETCH_GEO_IP_DONE;
-		}
-		
-		public function get FETCH_GEO_IP_ERROR():String
-		{
-			return _FETCH_GEO_IP_ERROR;
-		}
-		
-		public function get FETCH_MIRROR_CGI():String
-		{
-			return _FETCH_MIRROR_CGI;
-		}
-		
-		public function get FETCH_MIRROR_CGI_DONE():String
-		{
-			return _FETCH_MIRROR_CGI_DONE;
-		}
-		
-		public function get FETCH_MIRROR_CGI_ERROR():String
-		{
-			return _FETCH_MIRROR_CGI_ERROR;
-		}
+		return _content[name];
+	}
+	
+	//----------------------------------
+	//    hasEventListener
+	//----------------------------------
+	
+	public function hasEventListener(type:String):Boolean
+	{
+		return _eventDispatcher.hasEventListener(type);
+	}
+	
+	//----------------------------------
+	//    removeEventListener
+	//----------------------------------
+	
+	public function removeEventListener(type:String, listener:Function, 
+										useCapture:Boolean = false):void
+	{
+		_eventDispatcher.removeEventListener(type, listener, useCapture);
+	}
+	
+	//----------------------------------
+	//    update
+	//----------------------------------
+	
+	public function update(event:Event = null):void
+	{
+		_content = new Dictionary();
 		
-		public function get FETCH_MIRROR_LIST():String
-		{
-			return _FETCH_MIRROR_LIST;
-		}
+		var messageStringsContentDefault:Object;
+		var messageStringsContentLocalized:Object;
 		
-		public function get FETCH_MIRROR_LIST_DONE():String
-		{
-			return _FETCH_MIRROR_LIST_DONE;
-		}
+		var n:int = _resourceManager.localeChain.length;
+		messageStringsContentDefault = 
+				_resourceManager.getResourceBundle(_resourceManager.localeChain[n - 1], BUNDLE_NAME).content;
 		
-		public function get FETCH_MIRROR_LIST_PARSED():String
-		{
-			return _FETCH_MIRROR_LIST_PARSED;
-		}
+		if (n > 1)
+			messageStringsContentLocalized = 
+				_resourceManager.getResourceBundle(_resourceManager.localeChain[0], BUNDLE_NAME).content;
 		
-		public function get INFO_VERIFY_FLEX_SDK_DONE():String
+		var useLocalizedString:Boolean;
+		var event:Event;
+		for (var key:String in messageStringsContentDefault)
 		{
-			return _INFO_VERIFY_FLEX_SDK_DONE;
-		}
-		
-		public function get STEP_UNZIP_FLEX_SDK():String
-		{
-			return _STEP_UNZIP_FLEX_SDK;
-		}
-		
-		public function get INFO_DOWNLOADED():String
-		{
-			return _INFO_DOWNLOADED;
-		}
-
-		public function get ERROR_UNABLE_TO_COPY_FILE():String
-		{
-			return _ERROR_UNABLE_TO_COPY_FILE;
-		}
-
-		public function get INFO_INSTALLATION_COMPLETE():String
-		{
-			return _INFO_INSTALLATION_COMPLETE;
-		}
-
-		public function get INFO_INSTALLING_CONFIG_FILES():String
-		{
-			return _INFO_INSTALLING_CONFIG_FILES;
-		}
-
-		public function get INFO_INSTALLING_PLAYERGLOBAL_SWC():String
-		{
-			return _INFO_INSTALLING_PLAYERGLOBAL_SWC;
-		}
-
-		public function get INFO_FINISHED_UNTARING():String
-		{
-			return _INFO_FINISHED_UNTARING;
-		}
-
-		public function get ERROR_NATIVE_PROCESS_ERROR():String
-		{
-			return _ERROR_NATIVE_PROCESS_ERROR;
-		}
-
-		public function get ERROR_NATIVE_PROCESS_NOT_SUPPORTED():String
-		{
-			return _ERROR_NATIVE_PROCESS_NOT_SUPPORTED;
-		}
-
-		public function get INFO_DOWLOADING_AIR_RUNTIME_KIT_MAC():String
-		{
-			return _INFO_DOWLOADING_AIR_RUNTIME_KIT_MAC;
-		}
-
-		public function get INFO_DOWLOADING_AIR_RUNTIME_KIT_WINDOWS():String
-		{
-			return _INFO_DOWLOADING_AIR_RUNTIME_KIT_WINDOWS;
-		}
-
-		public function get INFO_FINISHED_UNZIPPING():String
-		{
-			return _INFO_FINISHED_UNZIPPING;
-		}
-
-		public function get INFO_UNZIPPING():String
-		{
-			return _INFO_UNZIPPING;
-		}
-
-		public function get INFO_DOWNLOADING_APACHE_FLEX_SDK():String
-		{
-			return _INFO_DOWNLOADING_APACHE_FLEX_SDK;
-		}
-
-		public function get INFO_CREATING_TEMP_DIR():String
-		{
-			return _INFO_CREATING_TEMP_DIR;
-		}
-
-		public function get INFO_CREATING_FLEX_HOME():String
-		{
-			return _INFO_CREATING_FLEX_HOME;
-		}
-
-		public function get INFO_SELECT_DIRECTORY():String
-		{
-			return _INFO_SELECT_DIRECTORY;
-		}
-
-		public function get INFO_INVOKED_GUI_MODE():String
-		{
-			return _INFO_INVOKED_GUI_MODE;
-		}
-
-		public function get INFO_ENTER_VALID_FLEX_SDK_PATH():String
-		{
-			return _INFO_ENTER_VALID_FLEX_SDK_PATH;
-		}
-
-		public function get ERROR_UNSUPPORTED_OPERATING_SYSTEM():String
-		{
-			return _ERROR_UNSUPPORTED_OPERATING_SYSTEM;
-		}
-
-		public function get ERROR_INVALID_AIR_SDK_URL_WINDOWS():String
-		{
-			return _ERROR_INVALID_AIR_SDK_URL_WINDOWS;
-		}
-
-		public function get CONFIG_URL():String
-		{
-			return _CONFIG_URL;
-		}
-
-		public function get APACHE_FLEX_URL():String
-		{
-			return _APACHE_FLEX_URL;
-		}
-
-		public function get INFO_APP_INVOKED():String
-		{
-			return _INFO_APP_INVOKED;
-		}
-
-		public function get ERROR_INVALID_FLASH_PLAYER_SWC_URL():String
-		{
-			return _ERROR_INVALID_FLASH_PLAYER_SWC_URL;
-		}
-
-		public function get ERROR_INVALID_AIR_SDK_URL_MAC():String
-		{
-			return _ERROR_INVALID_AIR_SDK_URL_MAC;
-		}
-
-		public function get ERROR_INVALID_SDK_URL():String
-		{
-			return _ERROR_INVALID_SDK_URL;
-		}
-
-		public function get ERROR_CONFIG_XML_LOAD():String
-		{
-			return _ERROR_CONFIG_XML_LOAD;
-		}
-
-		public function get CLOSE_BTN_LABEL():String
-		{
-			return _CLOSE_BTN_LABEL;
-		}
-
-		public function get INSTALL_LOG_BTN_LABEL():String
-		{
-			return _INSTALL_LOG_BTN_LABEL;
-		}
-
-		public function get BROWSE_BTN_LABEL():String
-		{
-			return _BROWSE_BTN_LABEL;
-		}
-
-		public function get SELECT_PATH_PROMPT():String
-		{
-			return _SELECT_PATH_PROMPT;
-		}
-
-		public function get INSTALL_BTN_LABEL():String
-		{
-			return _INSTALL_BTN_LABEL;
-		}
-
-		public function get STEP_CREATE_DIRECTORIES():String
-		{
-			return _STEP_CREATE_DIRECTORIES;
-		}
-
-		public function get STEP_DOWNLOAD_FLEX_SDK():String
-		{
-			return _STEP_DOWNLOAD_FLEX_SDK;
-		}
-
-		public function get STEP_DOWNLOAD_AIR_RUNTIME_KIT():String
-		{
-			return _STEP_DOWNLOAD_AIR_RUNTIME_KIT;
-		}
-
-		public function get STEP_UNZIP_AIR_RUNTIME_KIT():String
-		{
-			return _STEP_UNZIP_AIR_RUNTIME_KIT;
-		}
-
-		public function get STEP_DOWNLOAD_FLASHPLAYER_SWC():String
-		{
-			return _STEP_DOWNLOAD_FLASHPLAYER_SWC;
-		}
-
-		public function get STEP_INSTALL_CONFIG_FILES():String
-		{
-			return _STEP_INSTALL_CONFIG_FILES;
-		}
-
-		public function get ERROR_UNABLE_TO_DOWNLOAD_FLEX_SDK():String
-		{
-			return _ERROR_UNABLE_TO_DOWNLOAD_FLEX_SDK;
-		}
-
-		public function get ERROR_UNABLE_TO_DOWNLOAD_AIR_SDK():String
-		{
-			return _ERROR_UNABLE_TO_DOWNLOAD_AIR_SDK;
-		}
-
-		public function get ERROR_UNABLE_TO_DOWNLOAD_FLASH_PLAYER_SWC():String
-		{
-			return _ERROR_UNABLE_TO_DOWNLOAD_FLASH_PLAYER_SWC;
-		}
-
-		public function get INFO_ABORT_INSTALLATION():String
-		{
-			return _INFO_ABORT_INSTALLATION;
-		}
-
-		public function get ERROR_UNABLE_TO_DELETE_TEMP_DIRECTORY():String
-		{
-			return _ERROR_UNABLE_TO_DELETE_TEMP_DIRECTORY;
-		}
-
-		public function get ERROR_UNABLE_TO_CREATE_TEMP_DIRECTORY():String
-		{
-			return _ERROR_UNABLE_TO_CREATE_TEMP_DIRECTORY;
-		}
-
-		public function get ERROR_INVALID_FLEX_SDK_DIRECTORY():String
-		{
-			return _ERROR_INVALID_FLEX_SDK_DIRECTORY;
-		}
-
-		public function get ERROR_UNABLE_TO_INSTALL_CONFIG_FILES():String
-		{
-			return _ERROR_UNABLE_TO_INSTALL_CONFIG_FILES;
-		}
-
-		public function get NEXT_BTN_LABEL():String
-		{
-			return _NEXT_BTN_LABEL;
-		}
-
-		public function get ASK_OSMF():String
-		{
-			return _ASK_OSMF;
-		}
-
-		public function get ASK_BLAZEDS():String
-		{
-			return _ASK_BLAZEDS;
-		}
-
-		public function get ASK_TLF():String
-		{
-			return _ASK_TLF;
-		}
-
-		public function get ASK_FONTSWF():String
-		{
-			return _ASK_FONTSWF;
-		}
-
-		public function get INSTALL():String
-		{
-			return _INSTALL;
-		}
-
-		public function get DONT_INSTALL():String
-		{
-			return _DONT_INSTALL;
-		}
-
-		public function get STEP_OPTIONAL_INSTALL_FONTSWF():String
-		{
-			return _STEP_OPTIONAL_INSTALL_FONTSWF;
-		}
-
-		public function get STEP_OPTIONAL_INSTALL_BLAZEDS():String
-		{
-			return _STEP_OPTIONAL_INSTALL_BLAZEDS;
-		}
-
-		public function get STEP_OPTIONAL_INSTALL_TLF():String
-		{
-			return _STEP_OPTIONAL_INSTALL_TLF;
-		}
-
-		public function get STEP_OPTIONAL_INSTALL_OSMF():String
-		{
-			return _STEP_OPTIONAL_INSTALL_OSMF;
-		}
-
-		public function get INFO_DOWNLOADING_ADOBE_FLEX_SDK():String
-		{
-			return _INFO_DOWNLOADING_ADOBE_FLEX_SDK;
-		}
-
-		public function get ERROR_UNABLE_TO_DOWNLOAD_FILE():String
-		{
-			return _ERROR_UNABLE_TO_DOWNLOAD_FILE;
-		}
-
-		public function get ERROR_UNABLE_TO_UNZIP():String
-		{
-			return _ERROR_UNABLE_TO_UNZIP;
-		}
-
-		public function get INFO_DOWNLOADING_FILE_FROM():String
-		{
-			return _INFO_DOWNLOADING_FILE_FROM;
-		}
-
-		public function get INFO_NEED_TO_READ_AND_AGREE_TO_LICENSE():String
-		{
-			return _INFO_NEED_TO_READ_AND_AGREE_TO_LICENSE;
-		}
-
-		public function get MPL_LICENSE_BTN_LABEL():String
-		{
-			return _MPL_LICENSE_BTN_LABEL;
-		}
-
-		public function get ADOBE_LICENSE_BTN_LABEL():String
-		{
-			return _ADOBE_LICENSE_BTN_LABEL;
-		}
-
-		public function get INFO_INSTALLING():String
-		{
-			return _INFO_INSTALLING;
-		}
-
-		public function get OPEN_APACHE_FLEX_FOLDER_BTN_LABEL():String
-		{
-			return _OPEN_APACHE_FLEX_FOLDER_BTN_LABEL;
-		}
-
-		public function get ERROR_DIRECTORY_NOT_EMPTY():String
-		{
-			return _ERROR_DIRECTORY_NOT_EMPTY;
+			useLocalizedString = messageStringsContentLocalized && 
+				messageStringsContentLocalized[key] &&
+				messageStringsContentLocalized[key] != "";
+			
+			_content[key] = (useLocalizedString) ? 
+				messageStringsContentLocalized[key] : messageStringsContentDefault[key];
+			
+			event = PropertyChangeEvent.createUpdateEvent(this, key, "", _content[key]);
+			dispatchEvent(event);
 		}
-
+	}
 	
+	//----------------------------------
+	//    willTrigger
+	//----------------------------------
+	
+	public function willTrigger(type:String):Boolean
+	{
+		return _eventDispatcher.willTrigger(type);
 	}
+		
+}
 }
 
-class SingletonEnforcer{}
\ No newline at end of file
+class SE {}
\ No newline at end of file

Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as (original)
+++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/util/MD5CompareUtil.as Wed Aug 22 14:35:32 2012
@@ -33,7 +33,7 @@ import flash.filesystem.FileStream;
 import flash.net.URLLoader;
 import flash.net.URLLoaderDataFormat;
 import flash.net.URLRequest;
-import flash.utils.ByteArray;
+import flash.utils.ByteArray;
 
 [Event(name="progress", type="flash.events.ProgressEvent")]
 

Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml (original)
+++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/UpdaterDialog.mxml Wed Aug 22 14:35:32 2012
@@ -24,149 +24,147 @@
 			   title="Update available"
 			   xmlns:controls="ws.tink.spark.controls.*"
 			   skinClass="ws.tink.spark.skins.controls.UpdaterDialogSkin">
-	<fx:Script>
-		<![CDATA[
-			import air.update.events.DownloadErrorEvent;
-			import air.update.events.StatusUpdateEvent;
-			import air.update.events.UpdateEvent;
-			
-			import com.riaspace.nativeApplicationUpdater.utils.HdiutilHelper;
-			
-			import mx.controls.Alert;
-			import mx.events.CloseEvent;
-			import mx.utils.DisplayUtil;
-			
-			import org.apache.flex.packageflexsdk.util.DownloadUtil;
-			
-			[Bindable] private var _newVersion:String;
-			private var _urlWindows:String;
-			private var _fileWindows:File;
-			private var _urlMac:String;
-			private var _fileMac:File;
-			
-			protected function handleYesBtnClick(event:MouseEvent):void
-			{
-				currentState = "downloading";
-				downloadUpdater();
-			}
-			
-			protected function downloadUpdater():void
-			{
-				var os:String = Capabilities.os.toLowerCase();
-				if (os.indexOf("win") > -1)
-				{
-					DownloadUtil.download(_urlWindows,handleWindowsInstallerDownloadComplete,handleDownloadError, handleDownloadProgress);
-				}
-				else if (os.indexOf("mac") > -1)
-				{
-					DownloadUtil.download(_urlMac,handleMacInstallerDownloadComplete,handleDownloadError, handleDownloadProgress);
-				}
-			}
+	
+	<fx:Script><![CDATA[
+		
+		import air.update.events.DownloadErrorEvent;
+		import air.update.events.StatusUpdateEvent;
+		import air.update.events.UpdateEvent;
+		
+		import com.riaspace.nativeApplicationUpdater.utils.HdiutilHelper;
+		
+		import mx.controls.Alert;
+		import mx.core.Application;
+		import mx.core.FlexGlobals;
+		import mx.events.CloseEvent;
+		import mx.utils.DisplayUtil;
+		
+		import org.apache.flex.packageflexsdk.util.DownloadUtil;
+		import org.apache.flex.utilities.common.Constants;
+		import org.apache.flex.utilities.common.Tools;
+		
+		[Bindable] 
+		private var _newVersion:String;
+		
+		private var _fileWindows:File;
+		private var _fileMac:File;
+		
+		protected function handleYesBtnClick(event:MouseEvent):void
+		{
+			currentState = "downloading";
+			downloadUpdater();
+		}
+		
+		protected function downloadUpdater():void
+		{
+			var applicationExtension:String = Tools.getApplicationExtension();
+			var downloadCompleteHandler:Function =  
+				(applicationExtension == Constants.APPLICATION_EXTENSION_WIN) ? 
+				handleWindowsInstallerDownloadComplete : handleMacInstallerDownloadComplete;
+				
+			var main:Object = FlexGlobals.topLevelApplication;
 			
-			protected function handleWindowsInstallerDownloadComplete(event:Event):void
-			{
-				_fileWindows = File.createTempFile();
-				writeFileToDirectory(_fileWindows,event.target.data);
-				installFromFile(_fileWindows);
-			}
+			var url:String = 
+				main.installerAppPath + main.installerAppFileName + applicationExtension;
 			
-			protected function installFromFile(file:File):void
-			{
-				DownloadUtil.executeFile(file);
-				setTimeout(NativeApplication.nativeApplication.exit, 200);
-			}
+			DownloadUtil.download(url, downloadCompleteHandler, handleDownloadError, handleDownloadProgress);
+		}
+		
+		protected function handleWindowsInstallerDownloadComplete(event:Event):void
+		{
+			_fileWindows = File.createTempFile();
+			writeFileToDirectory(_fileWindows,event.target.data);
+			installFromFile(_fileWindows);
+		}
+		
+		protected function installFromFile(file:File):void
+		{
+			DownloadUtil.executeFile(file);
+			setTimeout(NativeApplication.nativeApplication.exit, 200);
+		}
+		
+		protected function handleMacInstallerDownloadComplete(event:Event):void
+		{
+			_fileMac = File.createTempFile();
+			writeFileToDirectory(_fileMac,event.target.data);
+			var hdiutilHelper:HdiutilHelper = new HdiutilHelper(_fileMac);
+			hdiutilHelper.addEventListener(Event.COMPLETE, handleHdiutilHelperComplete);
+			hdiutilHelper.addEventListener(ErrorEvent.ERROR, handleHdiutilHelperError);
+			hdiutilHelper.attach();
+		}
+		
+		private function handleHdiutilHelperComplete(event:Event):void
+		{
+			var hdiutilHelper:HdiutilHelper = event.target as HdiutilHelper;
+			hdiutilHelper.removeEventListener(Event.COMPLETE, handleHdiutilHelperComplete);
+			hdiutilHelper.removeEventListener(ErrorEvent.ERROR, handleHdiutilHelperError);
 			
-			protected function handleMacInstallerDownloadComplete(event:Event):void
-			{
-				_fileMac = File.createTempFile();
-				writeFileToDirectory(_fileMac,event.target.data);
-				var hdiutilHelper:HdiutilHelper = new HdiutilHelper(_fileMac);
-				hdiutilHelper.addEventListener(Event.COMPLETE, handleHdiutilHelperComplete);
-				hdiutilHelper.addEventListener(ErrorEvent.ERROR, handleHdiutilHelperError);
-				hdiutilHelper.attach();
-			}
+			var attachedDmg:File = new File(hdiutilHelper.mountPoint);
+			var files:Array = attachedDmg.getDirectoryListing();
 			
-			private function handleHdiutilHelperComplete(event:Event):void
+			if (files.length == 1)
 			{
-				var hdiutilHelper:HdiutilHelper = event.target as HdiutilHelper;
-				hdiutilHelper.removeEventListener(Event.COMPLETE, handleHdiutilHelperComplete);
-				hdiutilHelper.removeEventListener(ErrorEvent.ERROR, handleHdiutilHelperError);
-				
-				var attachedDmg:File = new File(hdiutilHelper.mountPoint);
-				var files:Array = attachedDmg.getDirectoryListing();
+				var installFileFolder:File = File(files[0]).resolvePath("Contents/MacOS");
+				var installFiles:Array = installFileFolder.getDirectoryListing();
 				
-				if (files.length == 1)
+				if (installFiles.length == 1)
 				{
-					var installFileFolder:File = File(files[0]).resolvePath("Contents/MacOS");
-					var installFiles:Array = installFileFolder.getDirectoryListing();
-					
-					if (installFiles.length == 1)
-					{
-						installFromFile(installFiles[0]);
-					}
-					else
-						dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, 
-							"Contents/MacOS folder should contain only 1 install file!"));
+					installFromFile(installFiles[0]);
 				}
 				else
-				{
 					dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, 
-						"Mounted volume should contain only 1 install file!"));
-				}
+						"Contents/MacOS folder should contain only 1 install file!"));
 			}
-			
-			private function handleHdiutilHelperError(event:ErrorEvent):void
+			else
 			{
-				var hdiutilHelper:HdiutilHelper = event.target as HdiutilHelper;
-				hdiutilHelper.removeEventListener(Event.COMPLETE, handleHdiutilHelperComplete);
-				hdiutilHelper.removeEventListener(ErrorEvent.ERROR, handleHdiutilHelperError);
-				
 				dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, 
-					"Error attaching dmg file!"));
-			}
-			
-			protected function handleDownloadProgress(event:ProgressEvent):void
-			{
-				var bytesTotal:int = event.bytesTotal;
-				var bytesLoaded:int = event.bytesLoaded;
-				var percentLoaded:int = Math.round(bytesLoaded*100/bytesTotal);
-				progressBar.percent = percentLoaded;
-			}
-			
-			
-			private function handleDownloadError(event:Event):void
-			{
-				Alert.show("Error downloading update file, try again later.");
-			}
-			
-			public function set versionXML(versionXML:XML):void
-			{
-				try
-				{
-					_urlWindows = versionXML.urlWindows.toString();
-					_urlMac = versionXML.urlMac.toString();
-					_newVersion = versionXML.version.toString();
-				}
-				catch(e:Error)
-				{
-					trace("Invalid version XML");
-				}
-			}
-			
-			private function writeFileToDirectory(file:File,data:ByteArray):void
-			{
-				var fs:FileStream = new FileStream();
-				fs.open(file, FileMode.WRITE);
-				fs.writeBytes(data); 
-				fs.close();
-			}
-			
-			protected function handleNoBtnClick(event:MouseEvent):void
-			{
-				dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
+					"Mounted volume should contain only 1 install file!"));
 			}
-		]]>
-	</fx:Script>
+		}
+		
+		private function handleHdiutilHelperError(event:ErrorEvent):void
+		{
+			var hdiutilHelper:HdiutilHelper = event.target as HdiutilHelper;
+			hdiutilHelper.removeEventListener(Event.COMPLETE, handleHdiutilHelperComplete);
+			hdiutilHelper.removeEventListener(ErrorEvent.ERROR, handleHdiutilHelperError);
+			
+			dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, 
+				"Error attaching dmg file!"));
+		}
+		
+		protected function handleDownloadProgress(event:ProgressEvent):void
+		{
+			var bytesTotal:int = event.bytesTotal;
+			var bytesLoaded:int = event.bytesLoaded;
+			var percentLoaded:int = Math.round(bytesLoaded*100/bytesTotal);
+			progressBar.percent = percentLoaded;
+		}
+		
+		
+		private function handleDownloadError(event:Event):void
+		{
+			Alert.show("Error downloading update file, try again later.");
+		}
+		
+		public function set latestVersion(value:String):void
+		{
+			_newVersion = value;
+		}
+		
+		private function writeFileToDirectory(file:File,data:ByteArray):void
+		{
+			var fs:FileStream = new FileStream();
+			fs.open(file, FileMode.WRITE);
+			fs.writeBytes(data); 
+			fs.close();
+		}
+		
+		protected function handleNoBtnClick(event:MouseEvent):void
+		{
+			dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
+		}
+		
+	]]></fx:Script>
 	
 	<s:states>
 		<s:State name="normal" />

Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml (original)
+++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/AdobeLicense.mxml Wed Aug 22 14:35:32 2012
@@ -74,6 +74,6 @@
 	</mx:ViewStack>
 	<s:HGroup width="100%" height="50" verticalAlign="middle" paddingRight="15">
 		<s:Spacer width="100%" />
-		<s:Button label="{ViewResourceConstants.getInstance().CLOSE_BTN_LABEL}" click="close()" styleName="genericBtnStyle"  />
+		<s:Button label="{ViewResourceConstants.instance.BTN_LABEL_CLOSE}" click="close()" styleName="genericBtnStyle"  />
 	</s:HGroup>
 </s:Window>
\ No newline at end of file

Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml (original)
+++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/ConsoleWindow.mxml Wed Aug 22 14:35:32 2012
@@ -66,6 +66,6 @@ limitations under the License.
 	<s:HGroup width="100%" >
 		<s:Button label="COPY LOG" click="handleCopyBtnClick(event)" styleName="genericBtnStyle"  />
 		<s:Spacer width="100%" />
-		<s:Button label="{ViewResourceConstants.getInstance().CLOSE_BTN_LABEL}" click="closeWindow(event)" styleName="genericBtnStyle"  />
+		<s:Button label="{ViewResourceConstants.instance.BTN_LABEL_CLOSE}" click="closeWindow(event)" styleName="genericBtnStyle"  />
 	</s:HGroup>
 </s:Window>

Modified: incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml (original)
+++ incubator/flex/utilities/trunk/installer/src/org/apache/flex/packageflexsdk/view/components/MPLLicense.mxml Wed Aug 22 14:35:32 2012
@@ -43,6 +43,6 @@ limitations under the License.
 		editable="false"/>
 	<s:HGroup width="100%" height="50" verticalAlign="middle" paddingRight="15" >
 		<s:Spacer width="100%" />
-		<s:Button label="{ViewResourceConstants.getInstance().CLOSE_BTN_LABEL}" click="close()" styleName="genericBtnStyle"  />
+		<s:Button label="{ViewResourceConstants.instance.BTN_LABEL_CLOSE}" click="close()" styleName="genericBtnStyle"  />
 	</s:HGroup>
 </s:Window>

Modified: incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html (original)
+++ incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html Wed Aug 22 14:35:32 2012
@@ -38,11 +38,7 @@
     <script type="text/javascript">
         var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
         var xiSwfUrlStr = "";
-        var flashvars = { 
-            "fileNamePrefix" : "apache-flex-sdk-",
-            "installerConfigFile": "ApacheFlexConfig.xml",
-            "installerFileName": "InstallApacheFlex",
-            "installerDownloadURL": "http://people.apache.org/~bigosmallm/installapacheflex/" };
+        var flashvars = {};
         var params = {};
         params.quality = "high";
         params.bgcolor = "${bgcolor}";

Modified: incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml (original)
+++ incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml Wed Aug 22 14:35:32 2012
@@ -30,16 +30,14 @@ limitations under the License.
 	
 	<fx:Script><![CDATA[
 		
-		import flash.net.navigateToURL;
-		
-		import flashx.textLayout.elements.TextFlow;
-		
 		import mx.controls.Alert;
-		import mx.core.FlexGlobals;
 		import mx.events.FlexEvent;
 		
 		import org.apache.flex.installApacheFlexBadge.resources.EmbeddedMedia;
-		import org.apache.flex.installApacheFlexBadge.utils.InternetUtil;
+		import org.apache.flex.utilities.common.Constants;
+		import org.apache.flex.utilities.common.InternetUtil;
+		import org.apache.flex.utilities.common.MirrorURLUtil;
+		import org.apache.flex.utilities.common.Tools;
 		
 		import spark.utils.TextFlowUtil;
 		
@@ -49,13 +47,6 @@ limitations under the License.
 		//
 		//----------------------------------------------------------------------
 		
-		private const AIR_SWF_URL:String = "http://airdownload.adobe.com/air/browserapi/air.swf";
-
-		private const APPLICATION_EXTENSION_MAC:String = ".dmg";
-		private const APPLICATION_EXTENSION_WIN:String = ".exe";
-		
-		private const ID_FILE_NODE:String = "ApacheFlexSDK";
-		
 		private const INFO_DISCLAIMER_XML:XML = 
 			<TextFlow xmlns="http://ns.adobe.com/textLayout/2008" fontFamily="openSansSemiBold">
 				<p>
@@ -69,18 +60,19 @@ limitations under the License.
 				<p>
 					While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
 				</p>
+				<br />
+				<p>
+					Notice: Apache and Apache Flex are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.
+				</p>
 			</TextFlow>;
 		private const INFO_ERROR_OPERATING_SYSTEM:String = "The Apache Flex SDK Installer application\nis not supported on your operating system.";
 		private const INFO_ERROR_RETRIEVE_CONFIG:String = "The application was unable to retrieve\nthe configuration file.";
-		private const INFO_FOR_IDE:String = "for Adobe Flash Builder";
+		private const INFO_FOR_IDE:String = "SDK Installation App";
 		
 		private const LABEL_BACK:String = "Close";
 		private const LABEL_DISCLAIMER:String = "( disclaimer )";
 		private const LABEL_DOWNLOAD:String = "DOWNLOAD";
 		
-		private const PLATFORM_MAC:String = "Mac";
-		private const PLATFORM_WIN:String = "Windows";
-		
 		private const TITLE_ERROR_INTERNET:String = "Internet Error";
 		private const TITLE_ERROR_PLATFORM:String = "Platform Error";
 		
@@ -92,16 +84,16 @@ limitations under the License.
 		
 		private var _applicationExtension:String;
 		
-		private var _fileNamePrefix:String;
+		private var _sdkBinaryFileName:String;
 		
-		private var _installerConfigFile:String;
-		
-		private var _installerDownloadURL:String;
+		private var _installerDownloadPath:String;
 		
 		private var _installerFileName:String;
 		
 		private var _internetUtil:InternetUtil;
 		
+		private var _mirrorURLUtil:MirrorURLUtil = MirrorURLUtil.instance;
+
 		[Bindable]
 		private var _sdkVersionString:String = "";
 		
@@ -117,12 +109,19 @@ limitations under the License.
 		
 		private function btnDownload_clickHandler(event:MouseEvent):void
 		{
-			btnDownload.enabled = false;
-			
-			var request:URLRequest = new URLRequest(
-				_installerDownloadURL + _installerFileName + _applicationExtension);
-			
-			navigateToURL(request, "_blank");
+			try
+			{
+				_applicationExtension = Tools.getApplicationExtension();
+
+				var request:URLRequest = new URLRequest(
+					_installerDownloadPath + _installerFileName + _applicationExtension);
+				
+				navigateToURL(request, "_blank");
+			}
+			catch (error:Error)
+			{
+				Alert.show(INFO_ERROR_OPERATING_SYSTEM, TITLE_ERROR_PLATFORM);
+			}
 		}
 		
 		//----------------------------------
@@ -130,38 +129,22 @@ limitations under the License.
 		//----------------------------------
 		
 		private function creationCompleteHandler(event:FlexEvent):void
-		{
-			if (FlexGlobals.topLevelApplication.parameters)
-			{
-				var parameters:Object = FlexGlobals.topLevelApplication.parameters;
-				
-				if (parameters.fileNamePrefix)
-					_fileNamePrefix = parameters.fileNamePrefix;
-				
-				if (parameters.installerConfigFile)
-					_installerConfigFile = parameters.installerConfigFile;
-				
-				if (parameters.installerFileName)
-					_installerFileName = parameters.installerFileName;
-				
-				if (parameters.installerDownloadURL)
-					_installerDownloadURL = parameters.installerDownloadURL;
-			}
-			
-			var platform:String = Capabilities.os.split(" ")[0];
-			if (platform == PLATFORM_WIN)
-				_applicationExtension = APPLICATION_EXTENSION_WIN;
-			else if (platform == PLATFORM_MAC)
-				_applicationExtension = APPLICATION_EXTENSION_MAC;
-			else
-				warnPlatformNotSupported();
-			
+		{
 			_internetUtil = InternetUtil.instance;
 			
 			_internetUtil.fetch(
-				_installerDownloadURL + _installerConfigFile, 
-				internetFetchResultHandler
-			);
+				Constants.APACHE_FLEX_URL + Constants.CONFIG_XML_NAME, internetFetchResultHandler);
+		}
+		
+		//----------------------------------
+		//    getMirrorURLResultHandler
+		//----------------------------------
+		
+		private function getMirrorURLResultHandler():void
+		{
+			_installerDownloadPath = _mirrorURLUtil.mirrorURL + _installerDownloadPath;
+			
+			parseSDKVersionNumber();
 		}
 		
 		//----------------------------------
@@ -170,15 +153,28 @@ limitations under the License.
 		
 		private function internetFetchResultHandler():void
 		{
-			var configXML:XML
-			
 			if (!_internetUtil.errorOccurred)
 			{
-				configXML = XML(_internetUtil.result);
+				var configXML:XML = XML(_internetUtil.result);
+				var files:XMLList = configXML.files.file;
 				
-				var fileName:String = configXML.files.file.(@name == ID_FILE_NODE).@file.toString();
+				_sdkBinaryFileName = files.(@name == "ApacheFlexSDK").@file.toString();
 				
-				parseSDKVersionNumber(fileName);
+				_installerFileName = files.(@name == 'SDKInstallerApp').@file.toString();
+				_installerDownloadPath = files.(@name == 'SDKInstallerApp').@path.toString();
+
+				if (_installerDownloadPath.substr(0, Constants.URL_PREFIX.length) != Constants.URL_PREFIX)
+				{
+					var mirrorURLCGI:String = files.(@name == 'MirrorURLCGI').@file.toString();
+					
+					_mirrorURLUtil.getMirrorURL(
+						Constants.APACHE_FLEX_URL + mirrorURLCGI,
+						getMirrorURLResultHandler);
+				}
+				else
+				{
+					parseSDKVersionNumber();
+				}
 			}
 			else
 			{
@@ -190,22 +186,13 @@ limitations under the License.
 		//    parseSDKVersionNumber
 		//----------------------------------
 		
-		private function parseSDKVersionNumber(fileName:String):void
+		private function parseSDKVersionNumber():void
 		{
-			_sdkVersionString = fileName.substr(_fileNamePrefix.length).split("-")[0];
+			_sdkVersionString = _sdkBinaryFileName.substr(Constants.SDK_BINARY_FILE_NAME_PREFIX.length).split("-")[0];
 			
 			btnDownload.enabled = true;
 		}
 		
-		//----------------------------------
-		//    warnPlatformNotSupported
-		//----------------------------------
-		
-		private function warnPlatformNotSupported():void
-		{
-			Alert.show(INFO_ERROR_OPERATING_SYSTEM, TITLE_ERROR_PLATFORM);
-		}
-		
 	]]></fx:Script>
 	
 	<fx:Declarations /> 
@@ -220,12 +207,12 @@ limitations under the License.
 	
 	<s:Image id="imgLogo" source="{EmbeddedMedia.logo}"
 			 height="165" width="164"
-			 top="5"
+			 top="10"
 			 horizontalCenter="0" />
 	
 	<s:Image id="imgHeader" source="{EmbeddedMedia.header}"
-			 height="37" width="106"
-			 top="181"
+			 height="37" width="136"
+			 top="185"
 			 left="75" />
 	
 	<s:Label text="{_sdkVersionString}"
@@ -233,18 +220,18 @@ limitations under the License.
 			 color="0x162545" fontSize="32"
 			 trackingLeft="-1" trackingRight="-1"
 			 width="137"
-			 left="163" top="190" />
+			 left="163" top="194" />
 	
 	<s:Label text="{INFO_FOR_IDE}"
-			 fontFamily="openSansSemibold"
-			 color="0x717C91" fontSize="13"
-			 textAlign="center"
-			 width="250"
-			 left="25" top="227" />
+			 width="190"
+			 left="25" top="235"
+			 color="0x162545" 
+			 fontFamily="openSansSemibold" fontSize="13"
+			 textAlign="center" />
 	
 	<s:Label text="{LABEL_DISCLAIMER}"
-			 width="250"
-			 left="25" top="245"
+			 width="60"
+			 left="190" top="236"
 			 color="0x717C91"
 			 fontFamily="openSansLightItalic" fontSize="11"
 			 textAlign="center"
@@ -252,7 +239,7 @@ limitations under the License.
 			 click="{currentState = 'disclaimerState'}" />
 	
 	<s:Button id="btnDownload" label="{LABEL_DOWNLOAD}"
-			  bottom="8"
+			  bottom="10"
 			  enabled="false"
 			  height="30"
 			  horizontalCenter="0"



Mime
View raw message