- optimized imports

git-svn-id: https://svn.apache.org/repos/asf/incubator/flex/whiteboard@1418810 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/StartHelperCommand.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/StartHelperCommand.as
index 3563293..3b42e7b 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/StartHelperCommand.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/StartHelperCommand.as
@@ -3,12 +3,12 @@
 

     import org.apache.flex.utilities.developerToolSuite.executor.domain.ISettingsModel;

     import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.CommandCallBackError;

-    import org.apache.flex.utilities.developerToolSuite.infrastructure.message.StartHelperMessage;

     import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ValidateAntPathMessage;

     import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ValidateCygwinPathMessage;

     import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ValidateJavaPathMessage;

     import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ValidateMavenPathMessage;

     import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.util.LogUtil;

+    import org.apache.flex.utilities.developerToolSuite.infrastructure.message.StartHelperMessage;

     import org.apache.flex.utilities.developerToolSuite.presentation.graphic.settings.SettingsWindow;

     import org.spicefactory.parsley.core.context.Context;

 

diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/event/ModalWindowEvent.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/event/ModalWindowEvent.as
index 8c1be3c..f568e52 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/event/ModalWindowEvent.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/event/ModalWindowEvent.as
@@ -1,13 +1,13 @@
 package org.apache.flex.utilities.developerToolSuite.infrastructure.event {

     import flash.events.Event;

 

-    public class ModalWindowEvent extends Event{

+    public class ModalWindowEvent extends Event {

 

         public static const OPENED:String = "opened";

         public static const CLOSED:String = "closed";

 

         public function ModalWindowEvent(type:String) {

-            super (type);

+            super(type);

         }

     }

 }

diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/SettingsWindow.mxml b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/SettingsWindow.mxml
index c5c6cb2..e819451 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/SettingsWindow.mxml
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/SettingsWindow.mxml
@@ -63,14 +63,14 @@
         import mx.managers.PopUpManager;

 

         import org.apache.flex.utilities.developerToolSuite.infrastructure.event.ModalWindowEvent;

-

         import org.spicefactory.parsley.core.context.Context;

 

         private static var __window:SettingsWindow;

 

         public static function show(context:Context, modal:Boolean = true):SettingsWindow {

-            if (__window)

+            if (__window) {

                 return __window;

+            }

 

             __window = new SettingsWindow();

 

@@ -100,7 +100,7 @@
             PopUpManager.centerPopUp(this);

         }

 

-        private function closeWindow():void{

+        private function closeWindow():void {

             PopUpManager.removePopUp(this);

             dispatchEvent(new ModalWindowEvent(ModalWindowEvent.CLOSED));

             __window = null;

diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/CommandCallBackError.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/CommandCallBackError.as
index da492c6..7e0dacb 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/CommandCallBackError.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/CommandCallBackError.as
@@ -1,5 +1,5 @@
 package org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command {

-    public class CommandCallBackError extends Error implements ICommandCallBack{

+    public class CommandCallBackError extends Error implements ICommandCallBack {

 

         public function CommandCallBackError(message:*, id:* = 0) {

             super(message);

diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/CommandCallBackResult.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/CommandCallBackResult.as
index 65ac47b..9152771 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/CommandCallBackResult.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/CommandCallBackResult.as
@@ -1,5 +1,5 @@
 package org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command {

-    public class CommandCallBackResult implements ICommandCallBack{

+    public class CommandCallBackResult implements ICommandCallBack {

 

         private var _result:*;

 

diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/GetSettingsFromDBCommand.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/GetSettingsFromDBCommand.as
new file mode 100644
index 0000000..24d864d
--- /dev/null
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/GetSettingsFromDBCommand.as
@@ -0,0 +1,65 @@
+/**

+ 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 org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command {

+    import flash.data.SQLResult;

+

+    import mx.resources.ResourceManager;

+    import mx.utils.ObjectUtil;

+

+    import org.apache.flex.utilities.developerToolSuite.LocaleUtil;

+    import org.apache.flex.utilities.developerToolSuite.executor.domain.SettingModel;

+    import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ApplicationReadyMessage;

+    import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.InitApplicationMessage;

+

+    public class GetSettingsFromDBCommand extends AbstractDBCommand {

+

+        [Inject]

+        public var settings:SettingModel;

+

+        public function execute(msg:InitApplicationMessage):void {

+            executeAsync();

+        }

+

+        override protected function prepareSql():void {

+            sql = "SELECT name, value FROM settings;";

+            super.prepareSql();

+        }

+

+        override protected function result(result:SQLResult):void {

+            var row:Object;

+

+            if (result.data) {

+                var numResults:int = result.data.length;

+                for (var i:int = 0; i < numResults; i++) {

+                    row = result.data[i];

+                    settings[row.name] = row.value;

+                }

+            }

+

+            if (settings.locale == null) {

+                settings.locale = LocaleUtil.getDefaultLanguage().data;

+            }

+            ResourceManager.getInstance().localeChain = LocaleUtil.getOrderedLocalChain(settings.locale);

+            dispatch(new ApplicationReadyMessage());

+

+            var resultMessage:String = (result.data != null) ? ObjectUtil.toString(result.data) : result.rowsAffected + " affected row(s)";

+            log.debug("Successfully executed shell: " + resultMessage);

+

+            callback(new CommandCallBackResult(settings));

+        }

+    }

+}

diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/ValidateCygwinPathCommand.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/ValidateCygwinPathCommand.as
index b3205a2..c740a75 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/ValidateCygwinPathCommand.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/ValidateCygwinPathCommand.as
@@ -15,7 +15,6 @@
  limitations under the License.

  */

 package org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command {

-    import flash.events.ProgressEvent;

     import flash.filesystem.File;

 

     import mx.logging.ILogger;

@@ -63,8 +62,7 @@
                     LOG.error("Error resolving CYGWIN_HOME");

                     callback(CommandCallBack.DEFAULT_ERROR);

                     return;

-                }

-                else {

+                } else {

                     LOG.debug("Resolved CYGWIN_HOME");

                     settings.cygwinEnabled = true;

                 }

diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.host-swf/src/main/flex/org/apache/flex/utilities/developerToolSuite/MainApplication.mxml b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.host-swf/src/main/flex/org/apache/flex/utilities/developerToolSuite/MainApplication.mxml
index 3146eee..3e9d952 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.host-swf/src/main/flex/org/apache/flex/utilities/developerToolSuite/MainApplication.mxml
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.host-swf/src/main/flex/org/apache/flex/utilities/developerToolSuite/MainApplication.mxml
@@ -54,13 +54,13 @@
         import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ApplicationReadyMessage;
         import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.InitApplicationMessage;
         import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.SaveSettingMessage;
-        import org.apache.flex.utilities.developerToolSuite.infrastructure.message.StartHelperMessage;
         import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ValidateAntPathMessage;
         import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ValidateCygwinPathMessage;
         import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ValidateJavaPathMessage;
         import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ValidateMavenPathMessage;
         import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.util.LogUtil;
         import org.apache.flex.utilities.developerToolSuite.infrastructure.event.ModalWindowEvent;
+        import org.apache.flex.utilities.developerToolSuite.infrastructure.message.StartHelperMessage;
         import org.apache.flex.utilities.developerToolSuite.presentation.config.SettingsContext;
         import org.apache.flex.utilities.developerToolSuite.presentation.graphic.menu.ApplicationMenu;