- Minor adjustments and error checking
- Added install button to the ToolHomeFormItems
- Fixed: Check doesn't run well when DB empty
git-svn-id: https://svn.apache.org/repos/asf/flex/whiteboard@1456921 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/LaunchUICommand.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/LaunchUICommand.as
index f798fe5..86ef7d7 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/LaunchUICommand.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/LaunchUICommand.as
@@ -6,6 +6,8 @@
import org.apache.flex.utilities.developerToolSuite.executor.domain.SettingModel;
import org.apache.flex.utilities.developerToolSuite.executor.domain.SettingsValidationProgressModel;
import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.CommandCallBack;
+ import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.CommandCallBackError;
+ import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.CommandCallBackResult;
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.ValidateGitPathMessage;
@@ -55,8 +57,9 @@
dispatch(new ValidateGitPathMessage());
}
- [CommandComplete]
- public function validateJavaPathCommandCompleted(trigger:ValidateJavaPathMessage):void {
+ [CommandResult]
+ public function validateJavaPathCommandResult(result:CommandCallBackResult, trigger:ValidateJavaPathMessage):void {
+ LOG.debug("Java path validation completed");
_javaCompleted = true;
_progress.currentStepLabel = "VALIDATING_ANT_HOME";
_progress.currentStep += 1;
@@ -64,15 +67,17 @@
}
[CommandError]
- public function validateJavaPathCommandError(trigger:ValidateJavaPathMessage):void {
+ public function validateJavaPathCommandError(fault:CommandCallBackError, trigger:ValidateJavaPathMessage):void {
+ LOG.debug("Java path validation error");
_javaCompleted = true;
_progress.currentStepLabel = "VALIDATING_ANT_HOME";
_progress.currentStep += 1;
checkValidationsCompleted();
}
- [CommandComplete]
- public function validateAntPathCommandCompleted(trigger:ValidateAntPathMessage):void {
+ [CommandResult]
+ public function validateAntPathCommandResult(result:CommandCallBackResult, trigger:ValidateAntPathMessage):void {
+ LOG.debug("Ant path validation completed");
_antCompleted = true;
_progress.currentStepLabel = "VALIDATING_MAVEN_HOME";
_progress.currentStep += 1;
@@ -80,15 +85,17 @@
}
[CommandError]
- public function validateAntPathCommandError(trigger:ValidateAntPathMessage):void {
+ public function validateAntPathCommandError(fault:CommandCallBackError, trigger:ValidateAntPathMessage):void {
+ LOG.debug("Ant path validation error");
_antCompleted = true;
_progress.currentStepLabel = "VALIDATING_MAVEN_HOME";
_progress.currentStep += 1;
checkValidationsCompleted();
}
- [CommandComplete]
- public function validateMavenPathCommandCompleted(trigger:ValidateMavenPathMessage):void {
+ [CommandResult]
+ public function validateMavenPathCommandResult(result:CommandCallBackResult, trigger:ValidateMavenPathMessage):void {
+ LOG.debug("Maven path validation completed");
_mavenCompleted = true;
_progress.currentStepLabel = "VALIDATING_CYGWIN_HOME";
_progress.currentStep += 1;
@@ -96,15 +103,17 @@
}
[CommandError]
- public function validateMavenPathCommandError(fault:Error, trigger:ValidateMavenPathMessage):void {
+ public function validateMavenPathCommandError(fault:CommandCallBackError, trigger:ValidateMavenPathMessage):void {
+ LOG.debug("Maven path validation error");
_mavenCompleted = true;
_progress.currentStepLabel = "VALIDATING_CYGWIN_HOME";
_progress.currentStep += 1;
checkValidationsCompleted();
}
- [CommandComplete]
- public function validateCygwinPathCommandCompleted(trigger:ValidateCygwinPathMessage):void {
+ [CommandResult]
+ public function validateCygwinPathCommandResult(result:CommandCallBackResult, trigger:ValidateCygwinPathMessage):void {
+ LOG.debug("Cygwin path validation completed");
_cygwinCompleted = true;
_progress.currentStepLabel = "VALIDATING_SVN_HOME";
_progress.currentStep += 1;
@@ -112,15 +121,17 @@
}
[CommandError]
- public function validateCygwinPathCommandError(fault:Error, trigger:ValidateCygwinPathMessage):void {
+ public function validateCygwinPathCommandError(fault:CommandCallBackError, trigger:ValidateCygwinPathMessage):void {
+ LOG.debug("Cygwin path validation error");
_cygwinCompleted = true;
_progress.currentStepLabel = "VALIDATING_SVN_HOME";
_progress.currentStep += 1;
checkValidationsCompleted();
}
- [CommandComplete]
- public function validateSvnPathCommandCompleted(trigger:ValidateSvnPathMessage):void {
+ [CommandResult]
+ public function validateSvnPathCommandResult(result:CommandCallBackResult, trigger:ValidateSvnPathMessage):void {
+ LOG.debug("SVN path validation completed");
_svnCompleted = true;
_progress.currentStepLabel = "VALIDATING_GIT_HOME";
_progress.currentStep += 1;
@@ -128,21 +139,24 @@
}
[CommandError]
- public function validateSvnPathCommandError(fault:Error, trigger:ValidateSvnPathMessage):void {
+ public function validateSvnPathCommandError(fault:CommandCallBackError, trigger:ValidateSvnPathMessage):void {
+ LOG.debug("SVN path validation error");
_svnCompleted = true;
_progress.currentStepLabel = "VALIDATING_GIT_HOME";
_progress.currentStep += 1;
checkValidationsCompleted();
}
- [CommandComplete]
- public function validateGitPathCommandCompleted(trigger:ValidateGitPathMessage):void {
+ [CommandResult]
+ public function validateGitPathCommandResult(result:CommandCallBackResult, trigger:ValidateGitPathMessage):void {
+ LOG.debug("GIT path validation completed");
_gitCompleted = true;
checkValidationsCompleted();
}
[CommandError]
- public function validateGiyPathCommandError(fault:Error, trigger:ValidateGitPathMessage):void {
+ public function validateGitPathCommandError(fault:CommandCallBackError, trigger:ValidateGitPathMessage):void {
+ LOG.debug("GIT path validation error");
_gitCompleted = true;
checkValidationsCompleted();
}
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/behavior/validator/ToolPathValidator.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/behavior/validator/ToolPathValidator.as
index fce4508..832e840 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/behavior/validator/ToolPathValidator.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/behavior/validator/ToolPathValidator.as
@@ -15,6 +15,8 @@
limitations under the License.
*/
package org.apache.flex.utilities.developerToolSuite.presentation.behavior.validator {
+ import mx.core.UIComponent;
+ import mx.managers.IFocusManagerComponent;
import mx.validators.ValidationResult;
import mx.validators.Validator;
@@ -42,6 +44,9 @@
if (Boolean(value) == false) {
validatorResults.push(new ValidationResult(true, null, "Tool Home Path Error",
resourceManager.getString('SettingsWindow', errorStringResourceString)));
+
+ IFocusManagerComponent(trigger).setFocus();
+
return validatorResults;
}
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/menu/GeneralMenu.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/menu/GeneralMenu.as
index 6f54aca..8927e97 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/menu/GeneralMenu.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/menu/GeneralMenu.as
@@ -15,6 +15,7 @@
limitations under the License.
*/
package org.apache.flex.utilities.developerToolSuite.presentation.graphic.menu {
+ import mx.core.FlexGlobals;
import mx.resources.ResourceManager;
import org.apache.flex.utilities.developerToolSuite.presentation.graphic.settings.SettingsWindow;
@@ -40,12 +41,12 @@
return getLocalizedLabel('QUIT');
}
- function GeneralMenu():void {
-
- }
-
public function openSettings(item:Object):void {
SettingsWindow.show(context);
}
+
+ public function quit(item:Object):void {
+ FlexGlobals.topLevelApplication.exitApplication();
+ }
}
}
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/GeneralSettings.mxml b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/GeneralSettings.mxml
index 9663cc9..8dd771d 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/GeneralSettings.mxml
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/GeneralSettings.mxml
@@ -38,7 +38,7 @@
gap="16"/>
</component:layout>
<s:DropDownList id="languageComboBox"
- change="localeComboBox_changeHandler(event)" width="100%"/>
+ change="languageComboBox_changeHandler(event)" width="100%"/>
</component:Frame>
</mx:GridItem>
<mx:GridItem rowSpan="4">
@@ -84,7 +84,7 @@
<mx:GridRow/>
<fx:Script><![CDATA[
- import org.apache.flex.utilities.developerToolSuite.executor.domain.ISettingsToSave;
+ import org.apache.flex.utilities.developerToolSuite.executor.domain.ISettingsModel;
import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.ChangeLanguageMessage;
import org.apache.flex.utilities.developerToolSuite.presentation.graphic.component.FrameSkin;
@@ -95,7 +95,7 @@
[Inject]
[Bindable]
- public var model:ISettingsToSave;
+ public var model:ISettingsModel;
[Init]
public function init():void {
@@ -106,7 +106,7 @@
= mavenHomeFormItem.dispatch = dispatch;
}
- private function localeComboBox_changeHandler(event:IndexChangeEvent):void {
+ private function languageComboBox_changeHandler(event:IndexChangeEvent):void {
dispatch(new ChangeLanguageMessage(languageComboBox.selectedItem.data));
}
]]></fx:Script>
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/formItem/ToolHomeFormItem.mxml b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/formItem/ToolHomeFormItem.mxml
index 4a03eb9..5744f2a 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/formItem/ToolHomeFormItem.mxml
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/formItem/ToolHomeFormItem.mxml
@@ -48,8 +48,12 @@
<s:helpContent>
<s:VGroup>
<s:Label text="{resourceManager.getString('SettingsWindow', helpLabelResourcesString)}"/>
- <mx:LinkButton label="{helpUrlText}"
- click="navigateToURL(new URLRequest(helpUrl));"/>
+ <s:HGroup>
+ <mx:LinkButton label="{helpUrlText}"
+ click="navigateToURL(new URLRequest(helpUrl));"/>
+ <mx:LinkButton label="Install"
+ click="navigateToURL(new URLRequest(helpUrl));"/>
+ </s:HGroup>
</s:VGroup>
</s:helpContent>
<fx:Script><![CDATA[
@@ -88,7 +92,7 @@
private function creationCompleteHandler(event:FlexEvent):void {
validator.validate();
- //dispatch(new validateToolMessageClass(propertyValue));
+ dispatch(new validateToolMessageClass(propertyValue));
}
private function browseButton_clickHandler(event:MouseEvent):void {
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/formItem/VCSFormItem.mxml b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/formItem/VCSFormItem.mxml
index 1d338d5..d0c0f0c 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/formItem/VCSFormItem.mxml
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/presentation/graphic/settings/formItem/VCSFormItem.mxml
@@ -60,7 +60,9 @@
public var dispatch:Function;
private function creationCompleteHandler(event:FlexEvent):void {
- dispatch(new validateVcsMessageClass());
+ if (dispatch) {
+ dispatch(new validateVcsMessageClass());
+ }
}
]]></fx:Script>
</s:FormItem>
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as
index f5183c1..e27c58e 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as
@@ -1,6 +1,7 @@
package org.apache.flex.utilities.developerToolSuite.executor.application.nativeProcess {
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
+ import flash.errors.IllegalOperationError;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IOErrorEvent;
@@ -72,7 +73,16 @@
_process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, dispatch2, false, 0, true);
_process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, dispatch2, false, 0, true);
_process.addEventListener(NativeProcessExitEvent.EXIT, exitHandler, false, -100, true);
- _process.start(nativeProcessStartupInfo);
+
+ try {
+ _process.start(nativeProcessStartupInfo);
+ } catch (error:IllegalOperationError) {
+ LOG.debug("Illegal Operation: {0}", error.toString());
+ } catch (error:ArgumentError) {
+ LOG.debug("Argument Error: {0}", error.toString());
+ } catch (error:Error) {
+ LOG.debug("Error: {0}", error.toString());
+ }
}
public function logMessages():void {
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ISettingsModel.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ISettingsModel.as
index b68a6df..f0a0d56 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ISettingsModel.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ISettingsModel.as
@@ -1,6 +1,28 @@
package org.apache.flex.utilities.developerToolSuite.executor.domain {
- [Bindable]
+ import flash.utils.Dictionary;
+
+ import mx.collections.ArrayCollection;
+
public interface ISettingsModel extends ISettingsToSave {
+
+ function get javaEnabled():Boolean;
+
+ function get antEnabled():Boolean;
+
+ function get mavenEnabled():Boolean;
+
+ function get cygwinEnabled():Boolean;
+
+ function get svnEnabled():Boolean;
+
+ function get gitEnabled():Boolean;
+
+ function get availableLanguages():ArrayCollection;
+
+ function get environmentVariables():Dictionary;
+
+ function get currentLanguage():Object;
+
function get validationInProgress():ISettingsValidationInProgressModel;
}
}
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ISettingsToSave.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ISettingsToSave.as
index 9a574a2..b4253a8 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ISettingsToSave.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ISettingsToSave.as
@@ -1,8 +1,4 @@
package org.apache.flex.utilities.developerToolSuite.executor.domain {
- import flash.utils.Dictionary;
-
- import mx.collections.ArrayCollection;
-
public interface ISettingsToSave {
function get dbVersion():uint;
@@ -11,12 +7,6 @@
function get appDisplayState():String;
- function get availableLanguages():ArrayCollection;
-
- function get currentLanguage():Object;
-
- function get environmentVariables():Dictionary;
-
function get locale():String;
function get JAVA_HOME():String;
@@ -26,17 +16,5 @@
function get MAVEN_HOME():String;
function get CYGWIN_HOME():String;
-
- function get javaEnabled():Boolean;
-
- function get antEnabled():Boolean;
-
- function get mavenEnabled():Boolean;
-
- function get cygwinEnabled():Boolean;
-
- function get svnEnabled():Boolean;
-
- function get gitEnabled():Boolean;
}
}
diff --git a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/AbstractShellCommand.as b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/AbstractShellCommand.as
index 9f84706..bedc901 100644
--- a/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/AbstractShellCommand.as
+++ b/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/command/AbstractShellCommand.as
@@ -82,7 +82,7 @@
}
protected function exitHandler(event:NativeProcessExitEvent):void {
- log.debug("Process exited with ", event.exitCode.toString());
+ log.debug("Process exited with: {0}", event.exitCode);
removeShellListeners();
}
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 ba8d084..c56305e 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
@@ -175,6 +175,10 @@
LogUtil.getLogger(this).info('Application Exit requested');
event.preventDefault();
+ exitApplication();
+ }
+
+ public function exitApplication():void {
var settingsToSave:Object = {};
settingsToSave.appBounds = _appBounds.x + "," + _appBounds.y + "," + _appBounds.width + "," + _appBounds.height;
settingsToSave.appDisplayState = nativeWindow.displayState;