author | john.dean.3@nokia.com |
Fri, 06 Nov 2009 12:39:13 -0600 | |
branch | RCL_2_4 |
changeset 568 | ee4c4ca48716 |
permissions | -rw-r--r-- |
568
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
1 |
/* |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
3 |
* All rights reserved. |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
8 |
* |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
9 |
* Initial Contributors: |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
11 |
* |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
12 |
* Contributors: |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
13 |
* |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
14 |
* Description: |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
15 |
* |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
16 |
*/ |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
17 |
package com.nokia.cdt.internal.debug.launch.wizard; |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
18 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
19 |
import java.util.List; |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
20 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
21 |
import org.eclipse.core.resources.IProject; |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
22 |
import org.eclipse.core.runtime.IPath; |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
23 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
24 |
/** |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
25 |
* Created for purposes of dependency injection on the LaunchCreationWizard. |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
26 |
* This instance allows for other factories to be substituted at runtime, for |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
27 |
* purposes of injecting at runtime LaunchCreationWizard sub-classes created by |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
28 |
* the automated tests |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
29 |
* |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
30 |
*/ |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
31 |
public class LaunchCreationWizardInstance { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
32 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
33 |
// The delegate factory |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
34 |
ILaunchCreationWizardFactory factory; |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
35 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
36 |
static private LaunchCreationWizardInstance instance = null; |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
37 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
38 |
/** |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
39 |
* Returns the singleton |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
40 |
* @return |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
41 |
*/ |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
42 |
public static LaunchCreationWizardInstance getInstance() { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
43 |
if (instance == null) { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
44 |
instance = new LaunchCreationWizardInstance(); |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
45 |
} |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
46 |
return instance; |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
47 |
} |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
48 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
49 |
private LaunchCreationWizardInstance() { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
50 |
setDefault(); |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
51 |
} |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
52 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
53 |
/** |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
54 |
* Returns the LaunchCreationWizard generated by the factory. |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
55 |
*/ |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
56 |
public LaunchCreationWizard create(IProject project, String configurationName, |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
57 |
List<IPath> mmps, List<IPath> exes, IPath defaultExecutable, |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
58 |
boolean isEmulation, boolean emulatorOnly, String mode) throws Exception { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
59 |
return factory.create(project, configurationName, mmps, exes, defaultExecutable, isEmulation, emulatorOnly, mode); |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
60 |
} |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
61 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
62 |
/** |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
63 |
* Sets the factory to the default product implementation. Used by the default initializer and to clear a dependency previously set |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
64 |
*/ |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
65 |
public void setDefault() { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
66 |
set(new ILaunchCreationWizardFactory() { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
67 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
68 |
public LaunchCreationWizard create(IProject project, String configurationName, |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
69 |
List<IPath> mmps, List<IPath> exes, IPath defaultExecutable, |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
70 |
boolean isEmulation, boolean emulatorOnly, String mode) |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
71 |
throws Exception { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
72 |
return new LaunchCreationWizard(project, configurationName, mmps, exes, defaultExecutable, isEmulation, emulatorOnly, mode); |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
73 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
74 |
} |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
75 |
}); |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
76 |
} |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
77 |
|
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
78 |
/** |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
79 |
* Intended to be used by tests to inject a custom factory |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
80 |
*/ |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
81 |
public void set(ILaunchCreationWizardFactory factory) { |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
82 |
this.factory = factory; |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
83 |
} |
ee4c4ca48716
Removed/added refactored class name which was missing in last commit
john.dean.3@nokia.com
parents:
diff
changeset
|
84 |
} |