443107 - Added checkbox "Launch/Restart AUT" to New/Edit AUT wizards

Signed-off-by: Mixail Bobylev <mixail.bobylev@xored.com>
Change-Id: I03ae83adff534bb8c60a9c16797a213e9fe83fbf
diff --git a/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/EditAUTWizard.java b/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/EditAUTWizard.java
index fa6d4d8..b3b830e 100644
--- a/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/EditAUTWizard.java
+++ b/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/EditAUTWizard.java
@@ -29,24 +29,27 @@
 import org.eclipse.pde.internal.launching.launcher.LaunchArgumentsHelper;
 import org.eclipse.pde.internal.launching.launcher.LaunchConfigurationHelper;
 import org.eclipse.pde.launching.IPDELauncherConstants;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-
+import org.eclipse.rcptt.internal.launching.aut.BaseAutManager;
 import org.eclipse.rcptt.internal.launching.aut.LaunchInfoCache;
 import org.eclipse.rcptt.internal.launching.ext.OSArchitecture;
 import org.eclipse.rcptt.internal.launching.ext.Q7TargetPlatformManager;
 import org.eclipse.rcptt.internal.launching.ext.UpdateVMArgs;
 import org.eclipse.rcptt.internal.ui.Q7UIPlugin;
+import org.eclipse.rcptt.launching.Aut;
 import org.eclipse.rcptt.launching.AutLaunch;
+import org.eclipse.rcptt.launching.AutLaunchState;
 import org.eclipse.rcptt.launching.AutManager;
 import org.eclipse.rcptt.launching.IQ7Launch;
 import org.eclipse.rcptt.launching.common.Q7LaunchingCommon;
 import org.eclipse.rcptt.launching.ext.Q7LaunchingUtil;
 import org.eclipse.rcptt.launching.target.ITargetPlatformHelper;
 import org.eclipse.rcptt.launching.target.TargetPlatformManager;
+import org.eclipse.rcptt.ui.launching.LaunchUtils;
 import org.eclipse.rcptt.ui.launching.aut.IAUTConfigWizard;
 import org.eclipse.rcptt.util.FileUtil;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
 
 @SuppressWarnings("restriction")
 public class EditAUTWizard extends Wizard implements IAUTConfigWizard {
@@ -251,6 +254,20 @@
 				if (list != null) {
 					AutManager.INSTANCE.updateAUTLaunches(newConfig, list);
 				}
+
+				if (page.isLaunchNeeded()) {
+					Aut aut = BaseAutManager.INSTANCE.getByName(workingCopy.getName());
+					if (aut != null) {
+						List<AutLaunch> autLaunches = aut.getLaunches();
+						for (AutLaunch autLaunch : autLaunches) {
+							if (autLaunch.getState() != AutLaunchState.TERMINATE) {
+								autLaunch.terminate();
+							}
+						}
+						LaunchUtils.launch(aut, getShell());
+					}
+				}
+
 				return true;
 			} catch (CoreException e) {
 				Q7UIPlugin.log(e);
diff --git a/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/NewAUTPage.java b/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/NewAUTPage.java
index 47af614..0eab849 100644
--- a/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/NewAUTPage.java
+++ b/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/NewAUTPage.java
@@ -18,7 +18,6 @@
 import org.eclipse.core.databinding.observable.ChangeEvent;
 import org.eclipse.core.databinding.observable.IChangeListener;
 import org.eclipse.core.databinding.observable.Observables;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
 import org.eclipse.core.databinding.observable.value.WritableValue;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -43,19 +42,6 @@
 import org.eclipse.jface.preference.PreferenceDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.ui.progress.UIJob;
-
 import org.eclipse.rcptt.internal.core.RcpttPlugin;
 import org.eclipse.rcptt.internal.launching.ext.JDTUtils;
 import org.eclipse.rcptt.internal.launching.ext.OSArchitecture;
@@ -73,6 +59,19 @@
 import org.eclipse.rcptt.launching.target.TargetPlatformManager;
 import org.eclipse.rcptt.ui.commons.SWTFactory;
 import org.eclipse.rcptt.util.FileUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.progress.UIJob;
 
 @SuppressWarnings("restriction")
 public class NewAUTPage extends WizardPage {
@@ -82,34 +81,22 @@
 
 	private WritableValue nameValue = new WritableValue("", String.class);
 	private WritableValue locationValue = new WritableValue("", String.class);
-	private WritableValue info = new WritableValue(null,
-			ITargetPlatformHelper.class);
-	private WritableValue platformArchitecture64 = new WritableValue(
-			Boolean.FALSE, Boolean.class);
-	private WritableValue platformArchitecture32 = new WritableValue(
-			Boolean.TRUE, Boolean.class);
+	private WritableValue info = new WritableValue(null, ITargetPlatformHelper.class);
+	private WritableValue platformArchitecture64 = new WritableValue(Boolean.FALSE, Boolean.class);
+	private WritableValue platformArchitecture32 = new WritableValue(Boolean.TRUE, Boolean.class);
+	private WritableValue architectureError = new WritableValue(Boolean.FALSE, Boolean.class);
+	private WritableValue archEnabled = new WritableValue(Boolean.TRUE, Boolean.class);
+	private WritableValue showAdvanced = new WritableValue(Boolean.FALSE, Boolean.class);
+	private WritableValue warningMessageValue = new WritableValue("", String.class);
+	private WritableValue autolaunchValue = new WritableValue(Boolean.TRUE, Boolean.class);
+	private WritableValue autolaunchLabel = new WritableValue("Launch AUT", String.class);
 
-	private WritableValue architectureError = new WritableValue(Boolean.FALSE,
-			Boolean.class);
-
-	private WritableValue archEnabled = new WritableValue(Boolean.TRUE,
-			Boolean.class);
-	private WritableValue showAdvanced = new WritableValue(Boolean.FALSE,
-			Boolean.class);
-
-	private WritableValue detailsValue = new WritableValue("", String.class);
-
-	private WritableValue warningMessageValue = new WritableValue("",
-			String.class);
 	private String JobFamily = "";
 	private OSArchitecture architecture;
 	private IVMInstall jvmInstall;
 	private OSArchitecture jvmArch;
 	private String currentName = null;
 	private Runnable advancedHandler;
-	private IObservableValue delayedName;
-	private ISWTObservableValue locationModifyObservable;
-	private ISWTObservableValue nameModifyObservable;
 
 	protected NewAUTPage(String pageName, String title,
 			ImageDescriptor titleImage) {
@@ -176,7 +163,6 @@
 
 		setMessage(helper.getWarningMessage());
 		setErrorMessage(null);
-		// setPageComplete(true);
 		if (((String) nameValue.getValue()).trim().length() == 0) {
 			String defaultProduct = helper.getDefaultProduct();
 			if (defaultProduct != null) {
@@ -189,12 +175,8 @@
 				}
 			}
 		}
-		// Extract some details
 
-		StringBuilder builder = new StringBuilder();
 		architecture = helper.detectArchitecture(false, new StringBuilder());
-		builder.append("name:").append(architecture).append("\n");
-
 		switch (architecture) {
 		case Unknown:
 			archEnabled.setValue(Boolean.TRUE);
@@ -238,7 +220,6 @@
 			return;
 		}
 
-		detailsValue.setValue(builder.toString());
 		if (validateAUTName()) {
 			setPageComplete(true);
 		}
@@ -353,8 +334,31 @@
 		GridLayoutFactory.swtDefaults().numColumns(3).applyTo(parent);
 		GridDataFactory.fillDefaults().grab(true, true).applyTo(parent);
 
-		Label l = new Label(parent, SWT.NONE);
-		l.setText("Location:");
+		createControlLocation(parent);
+		createControlName(parent);
+		createControlArch(parent);
+		createControlAdvanced(parent);
+		createControlAutolaunch(parent);
+		createControlWarning(parent);
+
+		IChangeListener validatePlatformListener = new IChangeListener() {
+			public void handleChange(ChangeEvent event) {
+				validatePlatform();
+			}
+		};
+		info.addChangeListener(validatePlatformListener);
+		platformArchitecture32.addChangeListener(validatePlatformListener);
+		platformArchitecture64.addChangeListener(validatePlatformListener);
+
+		setControl(parent);
+		validate(info.getValue() == null);
+		Dialog.applyDialogFont(parent);
+	}
+
+	private void createControlLocation(Composite parent) {
+		// Label and Field
+		Label locationLabel = new Label(parent, SWT.NONE);
+		locationLabel.setText("Location:");
 
 		Text locationField = new Text(parent, SWT.BORDER);
 		GridDataFactory.swtDefaults().grab(true, false)
@@ -362,17 +366,24 @@
 				.hint(IDialogConstants.ENTRY_FIELD_WIDTH, SWT.DEFAULT)
 				.applyTo(locationField);
 
-		locationModifyObservable = SWTObservables.observeText(locationField,
-				SWT.Modify);
+		// On change sets page complete = false
+		ISWTObservableValue locationModifyObservable = SWTObservables.observeText(locationField, SWT.Modify);
 		locationModifyObservable.addChangeListener(new IChangeListener() {
 			public void handleChange(ChangeEvent event) {
 				setPageComplete(false);
 			}
 		});
 		dbc.bindValue(
-				Observables.observeDelayedValue(500, locationModifyObservable),
+				Observables.observeDelayedValue(FIELD_TIMEOUT, locationModifyObservable),
 				locationValue);
+		// ... and runs validation after delay
+		locationValue.addChangeListener(new IChangeListener() {
+			public void handleChange(ChangeEvent event) {
+				validate(true);
+			}
+		});
 
+		// Browse button
 		Button fileLocationButton = new Button(parent, SWT.PUSH);
 		fileLocationButton.setText("&Browse...");
 		fileLocationButton.addSelectionListener(new SelectionAdapter() {
@@ -381,36 +392,46 @@
 				handleSelectLocation();
 			}
 		});
-		GridDataFactory.fillDefaults().grab(false, false)
-				.applyTo(fileLocationButton);
+		GridDataFactory.fillDefaults().grab(false, false).applyTo(fileLocationButton);
 		SWTFactory.setButtonDimensionHint(fileLocationButton);
+	}
 
-		l = new Label(parent, SWT.NONE);
-		l.setText("Name:");
+	private void createControlName(Composite parent) {
+		// Label and Field
+		Label nameLabel = new Label(parent, SWT.NONE);
+		nameLabel.setText("Name:");
+
 		Text nameField = new Text(parent, SWT.BORDER);
 		GridDataFactory.swtDefaults().grab(true, false)
 				.align(SWT.FILL, SWT.CENTER)
 				.hint(IDialogConstants.ENTRY_FIELD_WIDTH, SWT.DEFAULT)
 				.span(2, 1).applyTo(nameField);
 
-		nameModifyObservable = SWTObservables
-				.observeText(nameField, SWT.Modify);
+		// On change sets page complete = false
+		ISWTObservableValue nameModifyObservable = SWTObservables.observeText(nameField, SWT.Modify);
 		nameModifyObservable.addChangeListener(new IChangeListener() {
 			public void handleChange(ChangeEvent event) {
 				setPageComplete(false);
 			}
 		});
-		delayedName = Observables.observeDelayedValue(FIELD_TIMEOUT,
-				nameModifyObservable);
-		dbc.bindValue(delayedName, nameValue);
+		dbc.bindValue(
+				Observables.observeDelayedValue(FIELD_TIMEOUT, nameModifyObservable),
+				nameValue);
+		// ... and runs validation after delay
+		nameValue.addChangeListener(new IChangeListener() {
+			public void handleChange(ChangeEvent event) {
+				validatePlatform();
+			}
+		});
+	}
 
-		l = new Label(parent, SWT.NONE);
-		l.setText("Architecture:");
+	private void createControlArch(final Composite parent) {
+		Label archLabel = new Label(parent, SWT.NONE);
+		archLabel.setText("Architecture:");
+
 		Composite archGroup = new Composite(parent, SWT.NONE);
-		GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(true)
-				.applyTo(archGroup);
-		GridDataFactory.fillDefaults().span(1, 1).grab(true, false)
-				.applyTo(archGroup);
+		GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(true).applyTo(archGroup);
+		GridDataFactory.fillDefaults().span(1, 1).grab(true, false).applyTo(archGroup);
 		Button b32 = new Button(archGroup, SWT.RADIO);
 		Button b64 = new Button(archGroup, SWT.RADIO);
 		b32.setText("32bit");
@@ -418,16 +439,13 @@
 
 		dbc.bindValue(SWTObservables.observeEnabled(b32), archEnabled);
 		dbc.bindValue(SWTObservables.observeEnabled(b64), archEnabled);
-		dbc.bindValue(SWTObservables.observeSelection(b64),
-				platformArchitecture64);
-		dbc.bindValue(SWTObservables.observeSelection(b32),
-				platformArchitecture32);
+		dbc.bindValue(SWTObservables.observeSelection(b64), platformArchitecture64);
+		dbc.bindValue(SWTObservables.observeSelection(b32), platformArchitecture32);
 
-		Link link = new Link(parent, SWT.UNDERLINE_LINK);
-		link.setText("There is no appropriate JVM configured. <a>Configure JVM...</a>");
-		GridDataFactory.fillDefaults().span(3, 1).grab(true, false)
-				.applyTo(link);
-		link.addSelectionListener(new SelectionAdapter() {
+		final Link archLink = new Link(parent, SWT.UNDERLINE_LINK);
+		archLink.setText("There is no appropriate JVM configured. <a>Configure JVM...</a>");
+		GridDataFactory.fillDefaults().span(3, 1).grab(true, false).applyTo(archLink);
+		archLink.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				PreferenceDialog dialog = PreferencesUtil
@@ -438,10 +456,23 @@
 				}
 			}
 		});
-		Link advanced = new Link(parent, SWT.UNDERLINE_LINK);
+
+		ISWTObservableValue archLinkObservable = SWTObservables.observeVisible(archLink);
+		archLinkObservable.addChangeListener(new IChangeListener() {
+			public void handleChange(ChangeEvent event) {
+				// Hides container as well (like "display: none")
+				GridData data = (GridData) archLink.getLayoutData();
+				data.exclude = !archLink.getVisible();
+				parent.layout(false);
+			}
+		});
+		dbc.bindValue(archLinkObservable, architectureError);
+	}
+
+	private void createControlAdvanced(Composite parent) {
+		final Link advanced = new Link(parent, SWT.UNDERLINE_LINK);
 		advanced.setText("<a>Advanced...</a>");
-		GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(3, 1)
-				.grab(true, false).applyTo(advanced);
+		GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(3, 1).grab(true, false).applyTo(advanced);
 		advanced.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
@@ -450,40 +481,34 @@
 				}
 			}
 		});
-		Label warning = new Label(parent, SWT.WRAP);
-		warning.setText("");
-		GridDataFactory.fillDefaults().span(3, 1).grab(true, false)
-				.applyTo(warning);
-
-		dbc.bindValue(SWTObservables.observeText(warning), warningMessageValue);
 
 		dbc.bindValue(SWTObservables.observeVisible(advanced), showAdvanced);
+	}
 
-		dbc.bindValue(SWTObservables.observeVisible(link), architectureError);
+	private void createControlAutolaunch(Composite parent) {
+		Button autolaunch = new Button(parent, SWT.CHECK);
+		GridDataFactory.fillDefaults().span(3, 1).grab(true, false).applyTo(autolaunch);
+		autolaunch.setText("to del");
+		autolaunch.setSelection(true);
 
-		// Label details = new Label(parent, SWT.NONE);
-		// GridDataFactory.fillDefaults().grab(true, true).span(2, 1)
-		// .applyTo(details);
-		// dbc.bindValue(SWTObservables.observeText(details), detailsValue);
+		dbc.bindValue(SWTObservables.observeSelection(autolaunch), autolaunchValue);
+		dbc.bindValue(SWTObservables.observeText(autolaunch), autolaunchLabel);
+	}
 
-		locationValue.addChangeListener(new IChangeListener() {
+	private void createControlWarning(final Composite parent) {
+		Label warning = new Label(parent, SWT.WRAP);
+		warning.setText("");
+		GridDataFactory.fillDefaults().span(3, 1).grab(true, false).applyTo(warning);
+
+		ISWTObservableValue warningObservable = SWTObservables.observeText(warning);
+		warningObservable.addChangeListener(new IChangeListener() {
 			public void handleChange(ChangeEvent event) {
-				validate(true);
+				// Corrects size of the label
+				parent.layout(false);
 			}
 		});
-		IChangeListener validatePlatformListener = new IChangeListener() {
-			public void handleChange(ChangeEvent event) {
-				validatePlatform();
-			}
-		};
-		nameValue.addChangeListener(validatePlatformListener);
-		info.addChangeListener(validatePlatformListener);
-		platformArchitecture32.addChangeListener(validatePlatformListener);
-		platformArchitecture64.addChangeListener(validatePlatformListener);
 
-		setControl(parent);
-		validate(info.getValue() == null);
-		Dialog.applyDialogFont(parent);
+		dbc.bindValue(warningObservable, warningMessageValue);
 	}
 
 	protected void handleSelectLocation() {
@@ -515,6 +540,10 @@
 		return jvmArch;
 	}
 
+	public Boolean isLaunchNeeded() {
+		return (Boolean) autolaunchValue.getValue();
+	}
+
 	public OSArchitecture getArchitecture() {
 		if (Boolean.TRUE.equals(platformArchitecture32.getValue())) {
 			return OSArchitecture.x86;
@@ -553,6 +582,7 @@
 		}
 		nameValue.setValue(configName);
 		locationValue.setValue(autLocation);
+		Boolean isAutLaunched = false;
 		if (configuration != null) {
 			Aut launch = AutManager.INSTANCE.getByLaunch(configuration);
 			if (launch != null) {
@@ -561,11 +591,18 @@
 					if (autLaunch.getState().equals(AutLaunchState.ACTIVE)) {
 						warningMessageValue
 								.setValue("Running AUT is detected.\nPlease restart AUT manually, after configuration update, if required.");
+						isAutLaunched = true;
 						break;
 					}
 				}
 			}
 		}
+
+		if (isAutLaunched) {
+			autolaunchLabel.setValue("Restart AUT");
+		} else {
+			autolaunchLabel.setValue("Launch AUT");
+		}
 	}
 
 	public void addAdvancedHandler(Runnable runnable) {
diff --git a/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/NewAUTWizard.java b/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/NewAUTWizard.java
index 38e5aa7..17effeb 100644
--- a/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/NewAUTWizard.java
+++ b/rcp/org.eclipse.rcptt.launching.ext.ui/src/org/eclipse/rcptt/internal/launching/ext/ui/wizards/NewAUTWizard.java
@@ -22,8 +22,7 @@
 import org.eclipse.pde.internal.launching.IPDEConstants;
 import org.eclipse.pde.internal.launching.launcher.LaunchArgumentsHelper;
 import org.eclipse.pde.launching.IPDELauncherConstants;
-import org.eclipse.ui.IWorkbench;
-
+import org.eclipse.rcptt.internal.launching.aut.BaseAutManager;
 import org.eclipse.rcptt.internal.launching.ext.OSArchitecture;
 import org.eclipse.rcptt.internal.launching.ext.Q7TargetPlatformManager;
 import org.eclipse.rcptt.internal.launching.ext.UpdateVMArgs;
@@ -31,6 +30,8 @@
 import org.eclipse.rcptt.launching.common.Q7LaunchingCommon;
 import org.eclipse.rcptt.launching.ext.Q7LaunchingUtil;
 import org.eclipse.rcptt.launching.target.ITargetPlatformHelper;
+import org.eclipse.rcptt.ui.launching.LaunchUtils;
+import org.eclipse.ui.IWorkbench;
 
 @SuppressWarnings("restriction")
 public class NewAUTWizard extends Wizard {
@@ -145,7 +146,11 @@
 						.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, false);
 
 				workingCopy.doSave();
-				Q7TargetPlatformManager.setHelper(target.getName(), target);
+
+				if (page.isLaunchNeeded()) {
+					LaunchUtils.launch(BaseAutManager.INSTANCE.getByName(workingCopy.getName()), getShell());
+				}
+
 				return true;
 			} catch (CoreException e) {
 				Q7UIPlugin.log(e);
diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/launching/aut/AUTViewComposite.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/launching/aut/AUTViewComposite.java
index 687180e..e8cc241 100644
--- a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/launching/aut/AUTViewComposite.java
+++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/launching/aut/AUTViewComposite.java
@@ -16,6 +16,8 @@
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.rcptt.internal.ui.Images;
+import org.eclipse.rcptt.internal.ui.Messages;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.ui.IActionBars;
@@ -24,9 +26,6 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.menus.IMenuService;
 
-import org.eclipse.rcptt.internal.ui.Images;
-import org.eclipse.rcptt.internal.ui.Messages;
-
 public class AUTViewComposite extends BasicAUTComposite {
 	private IAction runAction;
 	private IAction stopAction;
@@ -67,12 +66,7 @@
 		manager.add(stopAction);
 
 		manager.add(new Separator());
-		configureAction = new Action() {
-			@Override
-			public void run() {
-				configure();
-			}
-		};
+
 		if (getInitWizard("new") != null) {
 			newAction = new Action() {
 				@Override
@@ -83,16 +77,23 @@
 			newAction.setImageDescriptor(getNewImage());
 			newAction
 					.setToolTipText(Messages.AUTViewComposite_NewActionToolTip);
-			manager.add(newAction);
 			newAction.setText(Messages.AUTViewComposite_NewActionText);
+			manager.add(newAction);
 		}
+
+		configureAction = new Action() {
+			@Override
+			public void run() {
+				configure();
+			}
+		};
 		configureAction.setImageDescriptor(PlatformUI.getWorkbench()
 				.getSharedImages()
 				.getImageDescriptor(ISharedImages.IMG_DEF_VIEW));
 		configureAction
 				.setToolTipText(Messages.AUTViewComposite_ConfigureActionToolTip);
-		manager.add(configureAction);
 		configureAction.setText(Messages.AUTViewComposite_ConfigureActionText);
+		manager.add(configureAction);
 
 		deleteAction = new Action() {
 			@Override
@@ -103,8 +104,8 @@
 		deleteAction.setImageDescriptor(getDeleteImage());
 		deleteAction
 				.setToolTipText(Messages.AUTViewComposite_RemoveActionToolTip);
-		manager.add(deleteAction);
 		deleteAction.setText(Messages.AUTViewComposite_RemoveActionText);
+		manager.add(deleteAction);
 	}
 
 	@Override
diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/launching/aut/BasicAUTComposite.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/launching/aut/BasicAUTComposite.java
index 265ba35..a1d8572 100644
--- a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/launching/aut/BasicAUTComposite.java
+++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/launching/aut/BasicAUTComposite.java
@@ -208,6 +208,7 @@
 						}
 					};
 					((IAUTConfigWizard) configWizard).setWizardDialog(dialog);
+					dialog.setHelpAvailable(false);
 					dialog.open();
 				} else {
 					// use default launch configuration configure wizard
@@ -286,6 +287,7 @@
 						.createImage());
 			}
 		};
+		dialog.setHelpAvailable(false);
 		dialog.open();
 		shell.forceActive();
 	}