debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessDialog.java
author dadubrow
Mon, 15 Feb 2010 13:49:01 -0600
changeset 956 d1e221a2875f
child 969 b0dd389735fb
permissions -rw-r--r--
new launch wizard implementation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
956
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     1
/*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     3
* All rights reserved.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     4
* This component and the accompanying materials are made available
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     6
* which accompanies this distribution, and is available
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     8
*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     9
* Initial Contributors:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    11
*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    12
* Contributors:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    13
*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    14
* Description: 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    15
*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    16
*/
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    17
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    18
package com.nokia.cdt.internal.debug.launch.newwizard;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    19
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    20
import java.io.File;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    21
import java.text.MessageFormat;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    22
import java.util.List;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    23
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    24
import org.eclipse.cdt.core.model.CoreModel;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    25
import org.eclipse.cdt.core.settings.model.CProjectDescriptionEvent;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    26
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    27
import org.eclipse.core.resources.IProject;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    28
import org.eclipse.core.runtime.IPath;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    29
import org.eclipse.core.runtime.IStatus;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    30
import org.eclipse.core.runtime.Path;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    31
import org.eclipse.core.runtime.Status;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    32
import org.eclipse.jface.layout.GridDataFactory;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    33
import org.eclipse.jface.layout.GridLayoutFactory;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    34
import org.eclipse.jface.resource.JFaceResources;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    35
import org.eclipse.jface.viewers.ArrayContentProvider;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    36
import org.eclipse.jface.viewers.ComboViewer;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    37
import org.eclipse.jface.viewers.ISelectionChangedListener;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    38
import org.eclipse.jface.viewers.IStructuredSelection;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    39
import org.eclipse.jface.viewers.LabelProvider;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    40
import org.eclipse.jface.viewers.SelectionChangedEvent;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    41
import org.eclipse.jface.viewers.StructuredSelection;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    42
import org.eclipse.swt.SWT;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    43
import org.eclipse.swt.events.ControlAdapter;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    44
import org.eclipse.swt.events.ControlEvent;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    45
import org.eclipse.swt.events.DisposeEvent;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    46
import org.eclipse.swt.events.DisposeListener;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    47
import org.eclipse.swt.events.ModifyEvent;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    48
import org.eclipse.swt.events.ModifyListener;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    49
import org.eclipse.swt.events.SelectionAdapter;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    50
import org.eclipse.swt.events.SelectionEvent;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    51
import org.eclipse.swt.layout.GridData;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    52
import org.eclipse.swt.widgets.Button;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    53
import org.eclipse.swt.widgets.Combo;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    54
import org.eclipse.swt.widgets.Composite;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    55
import org.eclipse.swt.widgets.Control;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    56
import org.eclipse.swt.widgets.FileDialog;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    57
import org.eclipse.swt.widgets.Label;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    58
import org.eclipse.swt.widgets.Link;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    59
import org.eclipse.swt.widgets.Shell;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    60
import org.eclipse.swt.widgets.Text;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    61
import org.eclipse.ui.dialogs.PreferencesUtil;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    62
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    63
import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    64
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    65
import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    66
import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    67
import com.nokia.cdt.internal.debug.launch.newwizard.LaunchWizardData.EExeSelection;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    68
import com.nokia.cpp.internal.api.utils.core.PathUtils;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    69
import com.nokia.cpp.internal.api.utils.ui.BrowseDialogUtils;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    70
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    71
/**
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    72
 *	This dialog allows in-depth configuration of the debug/run process options.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    73
 */
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    74
public class DebugRunProcessDialog extends AbstractLaunchSettingsDialog implements ICProjectDescriptionListener {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    75
	private ComboViewer projectExecutableViewer;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    76
	private Text remoteProgramEntry;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    77
	private Button projectExecutableRadioButton;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    78
	private Button remoteExecutableRadioButton;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    79
	private Button attachToProcessRadioButton;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    80
	
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    81
	private Label packageInfoLabel;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    82
	private Button installPackageCheckbox;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    83
	private Combo sisFile;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    84
	private Text sisEdit;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    85
	private Button sisBrowse;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    86
	private Composite installPackageUI;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    87
	
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    88
	protected DebugRunProcessDialog(Shell shell, LaunchWizardData data) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    89
		super(shell, data);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    90
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    91
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    92
	
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    93
	/* (non-Javadoc)
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    94
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    95
	 */
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    96
	@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    97
	protected Control createDialogArea(Composite parent) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    98
		Composite composite = initDialogArea(parent, 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    99
				MessageFormat.format("Change {0} Process", data.getModeLabel()),
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   100
				data.isDebug() ? LaunchWizardHelpIds.WIZARD_DIALOG_CHANGE_DEBUG_PROCESS : 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   101
					LaunchWizardHelpIds.WIZARD_DIALOG_CHANGE_RUN_PROCESS);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   102
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   103
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   104
		createProcessSelector(composite);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   105
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   106
		Label sep = new Label(composite, SWT.NONE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   107
		GridDataFactory.fillDefaults().applyTo(sep);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   108
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   109
		createPackageConfiguration(composite);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   110
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   111
		initUI();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   112
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   113
		validate();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   114
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   115
		return composite;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   116
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   117
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   118
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   119
	private void createProcessSelector(Composite composite) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   120
		Label label;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   121
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   122
		label = new Label(composite, SWT.WRAP);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   123
		label.setText(MessageFormat.format("{0} method:", data.getModeLabel()));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   124
		label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   125
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   126
		GridDataFactory.fillDefaults().grab(true, false).applyTo(composite);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   127
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   128
		Composite radioGroup = new Composite(composite, SWT.NONE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   129
		GridDataFactory.fillDefaults().grab(true, false).applyTo(radioGroup);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   130
		GridLayoutFactory.fillDefaults().extendedMargins(INDENT, 0, 0, 0).numColumns(2).applyTo(radioGroup);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   131
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   132
		createProjectExecutableRadioButton(radioGroup);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   133
		createRemoteExecutableRadioButton(radioGroup);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   134
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   135
		label = new Label(radioGroup, SWT.SEPARATOR | SWT.HORIZONTAL);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   136
		GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(label);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   137
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   138
		createAttachToProcessRadioButton(radioGroup);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   139
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   140
		String msg;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   141
		if (data.isDebug())
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   142
			msg = "Configure how to debug the program.  The initial settings reflect the debug capabilities of the selected device and the SIS builder settings.";
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   143
		else
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   144
			msg = "Configure how to run the program.";
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   145
		setMessage(msg);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   146
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   147
		switch (data.getExeSelection()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   148
		case USE_PROJECT_EXECUTABLE:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   149
			projectExecutableRadioButton.setSelection(true);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   150
			break;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   151
		case USE_REMOTE_EXECUTABLE:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   152
			remoteExecutableRadioButton.setSelection(true);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   153
			break;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   154
		case ATTACH_TO_PROCESS:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   155
			attachToProcessRadioButton.setSelection(true);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   156
			break;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   157
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   158
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   159
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   160
	private void createPackageConfiguration(Composite composite) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   161
		Label label;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   162
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   163
		label = new Label(composite, SWT.WRAP);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   164
		label.setText(MessageFormat.format("Deploy method:", data.getModeLabel()));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   165
		label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   166
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   167
		GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   168
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   169
		packageInfoLabel = new Label(composite, SWT.WRAP);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   170
		GridDataFactory.fillDefaults().grab(true, false).applyTo(packageInfoLabel);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   171
		composite.addControlListener(new ControlAdapter() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   172
			@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   173
			public void controlResized(ControlEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   174
				packageInfoLabel.pack();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   175
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   176
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   177
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   178
		installPackageCheckbox = new Button(composite, SWT.CHECK);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   179
		GridDataFactory.fillDefaults().applyTo(installPackageCheckbox);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   180
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   181
		installPackageCheckbox.setText("Install package before launch");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   182
		installPackageUI = new Composite(composite, SWT.NONE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   183
		GridDataFactory.fillDefaults().indent(INDENT, 0).applyTo(installPackageUI);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   184
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   185
		createSISContents(installPackageUI);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   186
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   187
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   188
		installPackageCheckbox.addSelectionListener(new SelectionAdapter() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   189
			@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   190
			public void widgetSelected(SelectionEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   191
				data.setInstallPackage(installPackageCheckbox.getSelection());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   192
				updatePackageUI();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   193
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   194
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   195
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   196
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   197
		if (data.isInstallPackage()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   198
			installPackageCheckbox.setSelection(true);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   199
			updatePackageUI();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   200
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   201
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   202
		updateSisFile();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   203
		updatePackageUI();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   204
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   205
	
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   206
    protected void createSISContents(Composite composite) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   207
        GridLayoutFactory.fillDefaults().margins(6, 6).numColumns(2).applyTo(composite);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   208
            
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   209
		final IProject project = data.getProject();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   210
		ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   211
		if (cpi != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   212
			final Label sisLabel = new Label(composite, SWT.NONE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   213
			sisLabel.setText("SIS File to Install:");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   214
			GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(1, 1).applyTo(sisLabel);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   215
			sisLabel.setToolTipText("Specify which SIS file to install on the phone prior to launching");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   216
			sisLabel.setData(UID, "DebugRunProcessDialog.sisLabel");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   217
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   218
			sisFile = new Combo(composite, SWT.READ_ONLY);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   219
			GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false).applyTo(sisLabel);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   220
			sisFile.setToolTipText("Specify which SIS file to install on the phone prior to launching"); 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   221
			sisFile.add("None"); //$NON-NLS-1$
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   222
			sisFile.setData(UID, "DebugRunProcessDialog.sisFile");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   223
			
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   224
			sisFile.addSelectionListener(new SelectionAdapter() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   225
				@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   226
				public void widgetSelected(SelectionEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   227
					updateSisFile();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   228
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   229
			});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   230
			
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   231
			ICarbideBuildConfiguration config = cpi.getDefaultConfiguration();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   232
			for (ISISBuilderInfo info : config.getSISBuilderInfoList()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   233
				IPath sisPath = info.getSigningType() == ISISBuilderInfo.DONT_SIGN ? info.getUnsignedSISFullPath() : info.getSignedSISFullPath();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   234
				sisFile.add(sisPath.toOSString());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   235
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   236
			
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   237
			// select the first sis file if any, otherwise select none
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   238
			if (sisFile.getItemCount() > 1) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   239
				sisFile.select(1);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   240
			} else {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   241
				sisFile.select(0);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   242
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   243
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   244
			// listen for events so we can detect if they click on the link below and add new sis info.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   245
			CoreModel.getDefault().getProjectDescriptionManager().addCProjectDescriptionListener(this, CProjectDescriptionEvent.APPLIED);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   246
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   247
			composite.addDisposeListener(new DisposeListener() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   248
				
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   249
				public void widgetDisposed(DisposeEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   250
					CoreModel.getDefault().getProjectDescriptionManager().removeCProjectDescriptionListener(DebugRunProcessDialog.this);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   251
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   252
			});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   253
			
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   254
			Link link = new Link(composite, SWT.NONE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   255
			link.setText("<a>" + "Modify SIS builder settings for build configuration" + "...</a>");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   256
			GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).span(2, 1).grab(true, false).applyTo(link);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   257
			link.addSelectionListener(new SelectionAdapter() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   258
				public void widgetSelected(SelectionEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   259
					PreferencesUtil.createPropertyDialogOn(getShell(), project, "com.nokia.carbide.cdt.internal.builder.ui.CarbideBuildConfigurationsPage", null, null).open();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   260
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   261
			});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   262
			link.setData(UID, "DebugRunProcessDialog.link");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   263
		} else {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   264
			// not a Carbide project, just an executable.  show a browse/edit combo
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   265
			// to let them select a sis file if they want to.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   266
			final Label sisLabel = new Label(composite, SWT.NONE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   267
			sisLabel.setText("SIS File to Install:"); //$NON-NLS-1$
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   268
			GridDataFactory.swtDefaults().span(2, 1).applyTo(sisLabel);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   269
			sisLabel.setToolTipText("Specify which SIS file to install on the phone prior to launching");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   270
			sisLabel.setData(UID, "DebugRunProcessDialog.sisLabel");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   271
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   272
			sisEdit = new Text(composite, SWT.BORDER);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   273
			GridDataFactory.fillDefaults().span(1, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(sisEdit);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   274
			sisEdit.setToolTipText("Specify which SIS file to install on the phone prior to launching");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   275
			sisEdit.addModifyListener(new ModifyListener() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   276
				public void modifyText(ModifyEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   277
					updateSisFile();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   278
					validate();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   279
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   280
			});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   281
			sisEdit.setData(UID, "DebugRunProcessDialog.sisEdit");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   282
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   283
			sisBrowse = new Button(composite, SWT.NONE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   284
			sisBrowse.setText("Browse...");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   285
			sisBrowse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   286
			sisBrowse.addSelectionListener(new SelectionAdapter() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   287
				public void widgetSelected(SelectionEvent evt) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   288
					FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   289
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   290
					dialog.setText("Select installation file");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   291
					dialog.setFilterExtensions(new String[] {"*.sis*", "*.*"});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   292
					dialog.setFilterNames(new String[] {"Installation Files", "All Files"});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   293
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   294
					BrowseDialogUtils.initializeFrom(dialog, sisEdit);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   295
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   296
					String result = dialog.open();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   297
					if (result != null && new File(result).exists()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   298
						sisEdit.setText(result);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   299
						updateSisFile();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   300
						validate();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   301
					}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   302
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   303
			});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   304
			sisBrowse.setData(UID, "DebugRunProcessDialog.sisBrowse");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   305
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   306
    }
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   307
    
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   308
    
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   309
	/**
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   310
	 * 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   311
	 */
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   312
	protected void updateSisFile() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   313
		String sisPath;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   314
    	if (sisFile != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   315
        	sisPath = sisFile.getSelectionIndex() == 0 ? null : sisFile.getText(); //$NON-NLS-1$
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   316
        	data.setSisPath(sisPath);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   317
    	} else if (sisEdit != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   318
    		sisPath = sisEdit.getText();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   319
    		data.setSisPath(sisPath);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   320
    	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   321
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   322
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   323
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   324
	private void updatePackageUI() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   325
		installPackageUI.setEnabled(data.isInstallPackage());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   326
		for (Control kid : installPackageUI.getChildren())
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   327
			kid.setEnabled(data.isInstallPackage());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   328
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   329
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   330
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   331
	public void handleEvent(CProjectDescriptionEvent event) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   332
		Shell shell = getShell();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   333
		if (shell == null || shell.isDisposed()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   334
			return;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   335
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   336
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   337
		IProject project = event.getProject() ;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   338
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   339
		if (project != data.getProject()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   340
			return;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   341
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   342
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   343
		if (sisFile != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   344
			ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   345
			if (cpi != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   346
				sisFile.removeAll();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   347
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   348
				sisFile.add("None");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   349
				
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   350
				ICarbideBuildConfiguration config = cpi.getDefaultConfiguration();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   351
				for (ISISBuilderInfo info : config.getSISBuilderInfoList()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   352
					IPath sisPath = info.getSigningType() == ISISBuilderInfo.DONT_SIGN ? info.getUnsignedSISFullPath() : info.getSignedSISFullPath();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   353
					sisFile.add(sisPath.toOSString());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   354
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   355
				
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   356
				// select the first sis file if any, otherwise select none
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   357
				if (sisFile.getItemCount() > 1) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   358
					sisFile.select(1);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   359
				} else {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   360
					sisFile.select(0);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   361
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   362
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   363
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   364
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   365
	
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   366
	protected void initUI() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   367
		List<IPath> exes = data.getExes();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   368
		projectExecutableViewer.setInput(exes);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   369
		IPath exeSelectionPath = data.getExeSelectionPath();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   370
		if (exeSelectionPath.equals(Path.EMPTY) && !exes.isEmpty())
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   371
			exeSelectionPath = exes.get(0);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   372
		projectExecutableViewer.setSelection(new StructuredSelection(exeSelectionPath));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   373
		IPath remotePath = createSuggestedRemotePath(exeSelectionPath);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   374
		remoteProgramEntry.setText(PathUtils.convertPathToWindows(remotePath));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   375
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   376
		if (data.getExeSelection() == EExeSelection.USE_PROJECT_EXECUTABLE && exeSelectionPath != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   377
			projectExecutableRadioButton.forceFocus();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   378
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   379
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   380
		if (data.getExeSelection() == EExeSelection.USE_REMOTE_EXECUTABLE && exeSelectionPath != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   381
			remoteExecutableRadioButton.forceFocus();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   382
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   383
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   384
		if (data.getExeSelection() == EExeSelection.ATTACH_TO_PROCESS) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   385
			attachToProcessRadioButton.forceFocus();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   386
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   387
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   388
		handleProjectExecutableRadioSelected();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   389
		handleRemoteExecutableRadioSelected();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   390
		handleAttachToProcessRadioSelected();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   391
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   392
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   393
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   394
	private IPath createSuggestedRemotePath(IPath exeSelectionPath) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   395
		String filename = exeSelectionPath.lastSegment();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   396
		return PathUtils.createPath("C:/sys/bin").append(filename);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   397
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   398
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   399
	/**
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   400
	 * Allow selecting an executable detected to be built by the program.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   401
	 * @param radioGroup
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   402
	 */
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   403
	private void createProjectExecutableRadioButton(Composite radioGroup) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   404
		projectExecutableRadioButton = new Button(radioGroup, SWT.RADIO);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   405
		GridDataFactory.fillDefaults().grab(false, false).applyTo(projectExecutableRadioButton);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   406
		projectExecutableRadioButton.setText("Launch project &executable:");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   407
		projectExecutableRadioButton.setData(UID, "radio_project_executable");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   408
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   409
		projectExecutableViewer = new ComboViewer(radioGroup, SWT.READ_ONLY);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   410
		GridDataFactory.fillDefaults().grab(true, false).applyTo(projectExecutableViewer.getControl());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   411
		projectExecutableViewer.getControl().setData(UID, "combo_project_executable");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   412
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   413
		projectExecutableViewer.setContentProvider(new ArrayContentProvider());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   414
		projectExecutableViewer.setLabelProvider(new LabelProvider() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   415
			@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   416
			public String getText(Object element) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   417
				if (element instanceof IPath)
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   418
					return ((IPath) element).lastSegment();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   419
				return super.getText(element);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   420
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   421
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   422
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   423
		projectExecutableRadioButton.addSelectionListener(new SelectionAdapter() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   424
			@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   425
			public void widgetSelected(SelectionEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   426
				handleProjectExecutableRadioSelected();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   427
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   428
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   429
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   430
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   431
		projectExecutableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   432
			
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   433
			public void selectionChanged(SelectionChangedEvent event) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   434
				Object sel = ((IStructuredSelection) event.getSelection()).getFirstElement();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   435
				if (sel instanceof IPath) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   436
					data.setExeSelectionPath((IPath) sel); 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   437
					
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   438
					// track the default remote program from the executable, for easy editing
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   439
					if (remoteProgramEntry != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   440
						IPath exeSelectionPath = createSuggestedRemotePath(data.getExeSelectionPath());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   441
						remoteProgramEntry.setText(PathUtils.convertPathToWindows(exeSelectionPath)); 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   442
					}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   443
					
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   444
					validate();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   445
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   446
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   447
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   448
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   449
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   450
	private void handleProjectExecutableRadioSelected() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   451
		if (projectExecutableRadioButton.getSelection()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   452
			projectExecutableViewer.getControl().setEnabled(true);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   453
			data.setExeSelection(EExeSelection.USE_PROJECT_EXECUTABLE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   454
			IPath selectedPath = (IPath) ((IStructuredSelection) projectExecutableViewer.getSelection()).getFirstElement();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   455
			if (selectedPath != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   456
				String symbianPath = PathUtils.convertPathToWindows(selectedPath);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   457
				data.setExeSelectionPath(new Path(symbianPath));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   458
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   459
			validate();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   460
		} else {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   461
			projectExecutableViewer.getControl().setEnabled(false);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   462
			// another button becomes active and sets the new launch process
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   463
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   464
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   465
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   466
	/**
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   467
	 * Allow user to enter an executable path.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   468
	 * @param radioGroup
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   469
	 */
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   470
	private void createRemoteExecutableRadioButton(Composite radioGroup) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   471
		remoteExecutableRadioButton = new Button(radioGroup, SWT.RADIO);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   472
		GridDataFactory.fillDefaults().grab(false, false).applyTo(remoteExecutableRadioButton);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   473
		remoteExecutableRadioButton.setText("Launch &remote program:");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   474
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   475
		remoteExecutableRadioButton.setData(UID, "radio_remote_program");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   476
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   477
		remoteProgramEntry = new Text(radioGroup, SWT.BORDER);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   478
		GridDataFactory.fillDefaults().grab(true, false).applyTo(remoteProgramEntry);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   479
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   480
		remoteProgramEntry.setData(UID, "text_remote_program");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   481
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   482
		remoteExecutableRadioButton.addSelectionListener(new SelectionAdapter() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   483
			@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   484
			public void widgetSelected(SelectionEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   485
				handleRemoteExecutableRadioSelected();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   486
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   487
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   488
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   489
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   490
		remoteProgramEntry.addModifyListener(new ModifyListener() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   491
			public void modifyText(ModifyEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   492
				data.setExeSelectionPath(new Path(remoteProgramEntry.getText().trim()));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   493
				validate();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   494
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   495
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   496
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   497
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   498
	private void handleRemoteExecutableRadioSelected() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   499
		if (remoteExecutableRadioButton.getSelection()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   500
			remoteProgramEntry.setEnabled(true);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   501
			data.setExeSelection(EExeSelection.USE_REMOTE_EXECUTABLE);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   502
			String symbianPath = PathUtils.convertPathToWindows(remoteProgramEntry.getText());
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   503
			data.setExeSelectionPath(new Path(symbianPath));
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   504
			validate();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   505
		} else {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   506
			remoteProgramEntry.setEnabled(false);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   507
			// another button becomes active and sets the new launch process
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   508
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   509
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   510
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   511
	/**
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   512
	 * Allow user to attach to a process.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   513
	 * @param radioGroup
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   514
	 */
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   515
	private void createAttachToProcessRadioButton(Composite radioGroup) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   516
		attachToProcessRadioButton = new Button(radioGroup, SWT.RADIO);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   517
		GridDataFactory.fillDefaults().grab(false, false).applyTo(attachToProcessRadioButton);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   518
		attachToProcessRadioButton.setText("&Attach to process:");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   519
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   520
		attachToProcessRadioButton.setData(UID, "radio_attach_to_process");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   521
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   522
		Label label = new Label(radioGroup, SWT.WRAP);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   523
		GridDataFactory.fillDefaults().grab(false, false).align(SWT.LEFT, SWT.CENTER).applyTo(label);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   524
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   525
		label.setText("(selected at launch time)");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   526
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   527
		attachToProcessRadioButton.addSelectionListener(new SelectionAdapter() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   528
			@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   529
			public void widgetSelected(SelectionEvent e) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   530
				handleAttachToProcessRadioSelected();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   531
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   532
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   533
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   534
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   535
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   536
	
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   537
	private void handleAttachToProcessRadioSelected() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   538
		if (attachToProcessRadioButton.getSelection()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   539
			data.setExeSelection(EExeSelection.ATTACH_TO_PROCESS);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   540
			data.setExeSelectionPath(null);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   541
			validate();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   542
		} else {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   543
			// another button becomes active and sets the new launch process
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   544
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   545
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   546
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   547
	@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   548
	protected void validate() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   549
		IStatus status = Status.OK_STATUS;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   550
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   551
		// check launch method
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   552
		IPath exePath = data.getExeSelectionPath(); 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   553
		switch (data.getExeSelection()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   554
		case USE_PROJECT_EXECUTABLE:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   555
			if (exePath.isEmpty()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   556
				status = error("The project builds no executables.");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   557
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   558
			break;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   559
		case USE_REMOTE_EXECUTABLE:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   560
			if (exePath.isEmpty()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   561
				status = error("Enter a non-empty executable path.");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   562
			} else {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   563
				String exePathString = exePath.toString();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   564
				char drive = exePathString.charAt(0);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   565
				char colon = exePathString.length() < 2 ? 0x0 : exePathString.charAt(1);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   566
				char root = exePathString.length() < 3 ? 0x0 : exePathString.charAt(2);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   567
				char lastChar = exePathString.charAt(exePathString.length() - 1);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   568
				if (!Character.isLetter(drive) || colon != ':' || (root != '\\' && root != '/') || 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   569
						lastChar == '\\' || lastChar == '/' || lastChar == ':') { 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   570
					status = error("The executable path must be absolute.");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   571
				} else if (exePath.getFileExtension() == null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   572
					status = warning("The executable path should end in a filename.");
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   573
				}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   574
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   575
			break;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   576
		case ATTACH_TO_PROCESS:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   577
			break;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   578
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   579
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   580
		// check SIS selection
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   581
		if (data.isInstallPackage()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   582
	    	if (sisEdit != null) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   583
	    		String text = sisEdit.getText().trim();
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   584
	    		if (text.length() > 0) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   585
	    			// empty is allowed, but if they specify something, make sure
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   586
	    			// it exists
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   587
	    			File file = new File(text);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   588
	    			if (!file.exists()) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   589
	    				status = error("The SIS file ''{0}'' does not exist.", text);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   590
	    			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   591
	    		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   592
	    	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   593
		}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   594
		
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   595
		updateStatus(status);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   596
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   597
}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
   598