Skip to content
Permalink
Browse files
- 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
  • Loading branch information
doublefx committed Mar 15, 2013
1 parent 9c10d25 commit 793d92d58ffed388b1e7a62a59725d29f804e36c
Showing 11 changed files with 95 additions and 55 deletions.
@@ -6,6 +6,8 @@ package org.apache.flex.utilities.developerToolSuite.infrastructure.command {
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,94 +57,106 @@ package org.apache.flex.utilities.developerToolSuite.infrastructure.command {
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;
checkValidationsCompleted();
}

[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;
checkValidationsCompleted();
}

[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;
checkValidationsCompleted();
}

[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;
checkValidationsCompleted();
}

[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;
checkValidationsCompleted();
}

[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();
}
@@ -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 @@ package org.apache.flex.utilities.developerToolSuite.presentation.behavior.valid
if (Boolean(value) == false) {
validatorResults.push(new ValidationResult(true, null, "Tool Home Path Error",
resourceManager.getString('SettingsWindow', errorStringResourceString)));

IFocusManagerComponent(trigger).setFocus();

return validatorResults;
}

@@ -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 @@ package org.apache.flex.utilities.developerToolSuite.presentation.graphic.menu {
return getLocalizedLabel('QUIT');
}

function GeneralMenu():void {

}

public function openSettings(item:Object):void {
SettingsWindow.show(context);
}

public function quit(item:Object):void {
FlexGlobals.topLevelApplication.exitApplication();
}
}
}
@@ -38,7 +38,7 @@ limitations under the License.
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 @@ limitations under the License.
<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 @@ limitations under the License.
[Inject]
[Bindable]
public var model:ISettingsToSave;
public var model:ISettingsModel;
[Init]
public function init():void {
@@ -106,7 +106,7 @@ limitations under the License.
= 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>
@@ -48,8 +48,12 @@ limitations under the License.
<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 @@ limitations under the License.
private function creationCompleteHandler(event:FlexEvent):void {
validator.validate();
//dispatch(new validateToolMessageClass(propertyValue));
dispatch(new validateToolMessageClass(propertyValue));
}
private function browseButton_clickHandler(event:MouseEvent):void {
@@ -60,7 +60,9 @@ limitations under the License.
public var dispatch:Function;
private function creationCompleteHandler(event:FlexEvent):void {
dispatch(new validateVcsMessageClass());
if (dispatch) {
dispatch(new validateVcsMessageClass());
}
}
]]></fx:Script>
</s:FormItem>
@@ -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 @@ package org.apache.flex.utilities.developerToolSuite.executor.application.native
_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 {
@@ -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;
}
}
@@ -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 @@ package org.apache.flex.utilities.developerToolSuite.executor.domain {

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 @@ package org.apache.flex.utilities.developerToolSuite.executor.domain {
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;
}
}
@@ -82,7 +82,7 @@ package org.apache.flex.utilities.developerToolSuite.executor.infrastructure.com
}

protected function exitHandler(event:NativeProcessExitEvent):void {
log.debug("Process exited with ", event.exitCode.toString());
log.debug("Process exited with: {0}", event.exitCode);
removeShellListeners();
}

@@ -175,6 +175,10 @@ limitations under the License.
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;

0 comments on commit 793d92d

Please sign in to comment.