|
Lines 76-81
Link Here
|
| 76 |
import org.eclipse.debug.core.ILaunchConfiguration; |
76 |
import org.eclipse.debug.core.ILaunchConfiguration; |
| 77 |
import org.eclipse.debug.core.ILaunchConfigurationListener; |
77 |
import org.eclipse.debug.core.ILaunchConfigurationListener; |
| 78 |
import org.eclipse.debug.core.ILaunchConfigurationType; |
78 |
import org.eclipse.debug.core.ILaunchConfigurationType; |
|
|
79 |
import org.eclipse.debug.core.ILaunchDelegate; |
| 79 |
import org.eclipse.debug.core.ILaunchListener; |
80 |
import org.eclipse.debug.core.ILaunchListener; |
| 80 |
import org.eclipse.debug.core.ILaunchManager; |
81 |
import org.eclipse.debug.core.ILaunchManager; |
| 81 |
import org.eclipse.debug.core.ILaunchMode; |
82 |
import org.eclipse.debug.core.ILaunchMode; |
|
Lines 507-523
Link Here
|
| 507 |
* @throws IOException if the encoding attempted to be used is not supported |
508 |
* @throws IOException if the encoding attempted to be used is not supported |
| 508 |
*/ |
509 |
*/ |
| 509 |
public static String serializeDocument(Document doc) throws TransformerException, IOException { |
510 |
public static String serializeDocument(Document doc) throws TransformerException, IOException { |
| 510 |
ByteArrayOutputStream s= new ByteArrayOutputStream(); |
511 |
ByteArrayOutputStream s = new ByteArrayOutputStream(); |
| 511 |
|
512 |
TransformerFactory factory = TransformerFactory.newInstance(); |
| 512 |
TransformerFactory factory= TransformerFactory.newInstance(); |
513 |
Transformer transformer = factory.newTransformer(); |
| 513 |
Transformer transformer= factory.newTransformer(); |
|
|
| 514 |
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ |
514 |
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ |
| 515 |
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ |
515 |
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ |
| 516 |
|
516 |
DOMSource source = new DOMSource(doc); |
| 517 |
DOMSource source= new DOMSource(doc); |
517 |
StreamResult outputTarget = new StreamResult(s); |
| 518 |
StreamResult outputTarget= new StreamResult(s); |
|
|
| 519 |
transformer.transform(source, outputTarget); |
518 |
transformer.transform(source, outputTarget); |
| 520 |
|
|
|
| 521 |
return s.toString("UTF8"); //$NON-NLS-1$ |
519 |
return s.toString("UTF8"); //$NON-NLS-1$ |
| 522 |
} |
520 |
} |
| 523 |
|
521 |
|
|
Lines 564-571
Link Here
|
| 564 |
private HashMap fLaunchOptions = null; |
562 |
private HashMap fLaunchOptions = null; |
| 565 |
|
563 |
|
| 566 |
/** |
564 |
/** |
|
|
565 |
* A map of ILaunchDelegate objects stored by id of delegate, or launch config type |
| 566 |
*/ |
| 567 |
private HashMap fLaunchDelegates = null; |
| 568 |
|
| 569 |
/** |
| 567 |
* List of contributed launch delegates (delegates contributed for existing |
570 |
* List of contributed launch delegates (delegates contributed for existing |
| 568 |
* launch configuration types). |
571 |
* launch configuration types). |
|
|
572 |
* |
| 573 |
* @deprecated as of 3.3M3, all delegates are treated as simply <code>ILaunchDelegate</code>s. there is no distinction |
| 574 |
* between them (those contributd via the launch config type and those contributed via a <code>launchDelegates</code> contribution. |
| 569 |
*/ |
575 |
*/ |
| 570 |
private List fContributedDelegates = null; |
576 |
private List fContributedDelegates = null; |
| 571 |
|
577 |
|
|
Lines 830-837
Link Here
|
| 830 |
} |
836 |
} |
| 831 |
Iterator iter = list.iterator(); |
837 |
Iterator iter = list.iterator(); |
| 832 |
List configs = new ArrayList(list.size()); |
838 |
List configs = new ArrayList(list.size()); |
|
|
839 |
IFile file = null; |
| 833 |
while (iter.hasNext()) { |
840 |
while (iter.hasNext()) { |
| 834 |
IFile file = (IFile)iter.next(); |
841 |
file = (IFile)iter.next(); |
| 835 |
configs.add(getLaunchConfiguration(file)); |
842 |
configs.add(getLaunchConfiguration(file)); |
| 836 |
} |
843 |
} |
| 837 |
return configs; |
844 |
return configs; |
|
Lines 856-863
Link Here
|
| 856 |
} |
863 |
} |
| 857 |
}; |
864 |
}; |
| 858 |
String[] files = directory.list(filter); |
865 |
String[] files = directory.list(filter); |
|
|
866 |
LaunchConfiguration config = null; |
| 859 |
for (int i = 0; i < files.length; i++) { |
867 |
for (int i = 0; i < files.length; i++) { |
| 860 |
LaunchConfiguration config = new LaunchConfiguration(containerPath.append(files[i])); |
868 |
config = new LaunchConfiguration(containerPath.append(files[i])); |
| 861 |
configs.add(config); |
869 |
configs.add(config); |
| 862 |
} |
870 |
} |
| 863 |
} |
871 |
} |
|
Lines 893-905
Link Here
|
| 893 |
try { |
901 |
try { |
| 894 |
index = Integer.parseInt(trailer); |
902 |
index = Integer.parseInt(trailer); |
| 895 |
baseName = baseName.substring(0, copyIndex); |
903 |
baseName = baseName.substring(0, copyIndex); |
| 896 |
} catch (NumberFormatException nfe) { |
904 |
} |
| 897 |
} |
905 |
catch (NumberFormatException nfe) {} |
| 898 |
} |
906 |
} |
| 899 |
} |
907 |
} |
| 900 |
String newName = baseName; |
908 |
String newName = baseName; |
| 901 |
|
909 |
|
| 902 |
StringBuffer buffer= null; |
910 |
StringBuffer buffer = null; |
| 903 |
while (isExistingLaunchConfigurationName(newName)) { |
911 |
while (isExistingLaunchConfigurationName(newName)) { |
| 904 |
buffer = new StringBuffer(baseName); |
912 |
buffer = new StringBuffer(baseName); |
| 905 |
buffer.append(" ("); //$NON-NLS-1$ |
913 |
buffer.append(" ("); //$NON-NLS-1$ |
|
Lines 995-1010
Link Here
|
| 995 |
List configs = new ArrayList(4); |
1003 |
List configs = new ArrayList(4); |
| 996 |
NodeList list = root.getChildNodes(); |
1004 |
NodeList list = root.getChildNodes(); |
| 997 |
int length = list.getLength(); |
1005 |
int length = list.getLength(); |
|
|
1006 |
Node node = null; |
| 1007 |
Element entry = null; |
| 1008 |
String memento = null; |
| 998 |
for (int i = 0; i < length; ++i) { |
1009 |
for (int i = 0; i < length; ++i) { |
| 999 |
Node node = list.item(i); |
1010 |
node = list.item(i); |
| 1000 |
short type = node.getNodeType(); |
1011 |
short type = node.getNodeType(); |
| 1001 |
if (type == Node.ELEMENT_NODE) { |
1012 |
if (type == Node.ELEMENT_NODE) { |
| 1002 |
Element entry = (Element) node; |
1013 |
entry = (Element) node; |
| 1003 |
String nodeName = entry.getNodeName(); |
1014 |
if (!entry.getNodeName().equals("launchConfiguration")) { //$NON-NLS-1$ |
| 1004 |
if (!nodeName.equals("launchConfiguration")) { //$NON-NLS-1$ |
|
|
| 1005 |
throw invalidFormat; |
1015 |
throw invalidFormat; |
| 1006 |
} |
1016 |
} |
| 1007 |
String memento = entry.getAttribute("memento"); //$NON-NLS-1$ |
1017 |
memento = entry.getAttribute("memento"); //$NON-NLS-1$ |
| 1008 |
if (memento == null) { |
1018 |
if (memento == null) { |
| 1009 |
throw invalidFormat; |
1019 |
throw invalidFormat; |
| 1010 |
} |
1020 |
} |
|
Lines 1016-1033
Link Here
|
| 1016 |
|
1026 |
|
| 1017 |
protected ConfigurationNotifier getConfigurationNotifier() { |
1027 |
protected ConfigurationNotifier getConfigurationNotifier() { |
| 1018 |
return new ConfigurationNotifier(); |
1028 |
return new ConfigurationNotifier(); |
| 1019 |
} |
1029 |
} |
| 1020 |
|
|
|
| 1021 |
/** |
| 1022 |
* Returns a list of launch delegates contributed for existing launch configuration |
| 1023 |
* types. |
| 1024 |
* |
| 1025 |
* @return list of ContributedDelegate |
| 1026 |
*/ |
| 1027 |
protected List getContributedDelegates() { |
| 1028 |
initializeContributedDelegates(); |
| 1029 |
return fContributedDelegates; |
| 1030 |
} |
| 1031 |
|
1030 |
|
| 1032 |
/** |
1031 |
/** |
| 1033 |
* @see ILaunchManager#getDebugTargets() |
1032 |
* @see ILaunchManager#getDebugTargets() |
|
Lines 1036-1044
Link Here
|
| 1036 |
synchronized (fLaunches) { |
1035 |
synchronized (fLaunches) { |
| 1037 |
List allTargets= new ArrayList(fLaunches.size()); |
1036 |
List allTargets= new ArrayList(fLaunches.size()); |
| 1038 |
if (fLaunches.size() > 0) { |
1037 |
if (fLaunches.size() > 0) { |
| 1039 |
Iterator e= fLaunches.iterator(); |
1038 |
Iterator e = fLaunches.iterator(); |
|
|
1039 |
IDebugTarget[] targets = null; |
| 1040 |
while (e.hasNext()) { |
1040 |
while (e.hasNext()) { |
| 1041 |
IDebugTarget[] targets= ((ILaunch) e.next()).getDebugTargets(); |
1041 |
targets = ((ILaunch) e.next()).getDebugTargets(); |
| 1042 |
for (int i = 0; i < targets.length; i++) { |
1042 |
for (int i = 0; i < targets.length; i++) { |
| 1043 |
allTargets.add(targets[i]); |
1043 |
allTargets.add(targets[i]); |
| 1044 |
} |
1044 |
} |
|
Lines 1073-1082
Link Here
|
| 1073 |
if (configEnv == null) { |
1073 |
if (configEnv == null) { |
| 1074 |
return null; |
1074 |
return null; |
| 1075 |
} |
1075 |
} |
| 1076 |
Map env = null; |
1076 |
Map env = new HashMap(); |
| 1077 |
// build base environment |
1077 |
// build base environment |
| 1078 |
env= new HashMap(); |
1078 |
boolean append = configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true); |
| 1079 |
boolean append= configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true); |
|
|
| 1080 |
if (append) { |
1079 |
if (append) { |
| 1081 |
env.putAll(getNativeEnvironmentCasePreserved()); |
1080 |
env.putAll(getNativeEnvironmentCasePreserved()); |
| 1082 |
} |
1081 |
} |
|
Lines 1084-1093
Link Here
|
| 1084 |
// Add variables from config |
1083 |
// Add variables from config |
| 1085 |
Iterator iter= configEnv.entrySet().iterator(); |
1084 |
Iterator iter= configEnv.entrySet().iterator(); |
| 1086 |
boolean win32= Platform.getOS().equals(Constants.OS_WIN32); |
1085 |
boolean win32= Platform.getOS().equals(Constants.OS_WIN32); |
|
|
1086 |
Map.Entry entry = null; |
| 1087 |
String key = null; |
| 1088 |
String value = null; |
| 1089 |
Object nativeValue = null; |
| 1090 |
Iterator envIter = null; |
| 1091 |
Map.Entry nativeEntry = null; |
| 1092 |
String nativeKey = null; |
| 1087 |
while (iter.hasNext()) { |
1093 |
while (iter.hasNext()) { |
| 1088 |
Map.Entry entry= (Map.Entry) iter.next(); |
1094 |
entry = (Map.Entry) iter.next(); |
| 1089 |
String key= (String) entry.getKey(); |
1095 |
key = (String) entry.getKey(); |
| 1090 |
String value = (String) entry.getValue(); |
1096 |
value = (String) entry.getValue(); |
| 1091 |
// translate any string substitution variables |
1097 |
// translate any string substitution variables |
| 1092 |
if (value != null) { |
1098 |
if (value != null) { |
| 1093 |
value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value); |
1099 |
value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value); |
|
Lines 1095-1101
Link Here
|
| 1095 |
boolean added= false; |
1101 |
boolean added= false; |
| 1096 |
if (win32) { |
1102 |
if (win32) { |
| 1097 |
// First, check if the key is an exact match for an existing key. |
1103 |
// First, check if the key is an exact match for an existing key. |
| 1098 |
Object nativeValue= env.get(key); |
1104 |
nativeValue = env.get(key); |
| 1099 |
if (nativeValue != null) { |
1105 |
if (nativeValue != null) { |
| 1100 |
// If an exact match is found, just replace the value |
1106 |
// If an exact match is found, just replace the value |
| 1101 |
env.put(key, value); |
1107 |
env.put(key, value); |
|
Lines 1103-1115
Link Here
|
| 1103 |
// Win32 vars are case-insensitive. If an exact match isn't found, iterate to |
1109 |
// Win32 vars are case-insensitive. If an exact match isn't found, iterate to |
| 1104 |
// check for a case-insensitive match. We maintain the key's case (see bug 86725), |
1110 |
// check for a case-insensitive match. We maintain the key's case (see bug 86725), |
| 1105 |
// but do a case-insensitive comparison (for example, "pAtH" will still override "PATH"). |
1111 |
// but do a case-insensitive comparison (for example, "pAtH" will still override "PATH"). |
| 1106 |
Iterator envIter= env.entrySet().iterator(); |
1112 |
envIter = env.entrySet().iterator(); |
| 1107 |
while (envIter.hasNext()) { |
1113 |
while (envIter.hasNext()) { |
| 1108 |
Map.Entry nativeEntry = (Map.Entry) envIter.next(); |
1114 |
nativeEntry = (Map.Entry) envIter.next(); |
| 1109 |
String nativeKey= (String) (nativeEntry).getKey(); |
1115 |
nativeKey = (String) (nativeEntry).getKey(); |
| 1110 |
if (nativeKey.equalsIgnoreCase(key)) { |
1116 |
if (nativeKey.equalsIgnoreCase(key)) { |
| 1111 |
nativeEntry.setValue(value); |
1117 |
nativeEntry.setValue(value); |
| 1112 |
added= true; |
1118 |
added = true; |
| 1113 |
break; |
1119 |
break; |
| 1114 |
} |
1120 |
} |
| 1115 |
} |
1121 |
} |
|
Lines 1120-1130
Link Here
|
| 1120 |
} |
1126 |
} |
| 1121 |
} |
1127 |
} |
| 1122 |
|
1128 |
|
| 1123 |
iter= env.entrySet().iterator(); |
1129 |
iter = env.entrySet().iterator(); |
| 1124 |
List strings= new ArrayList(env.size()); |
1130 |
List strings = new ArrayList(env.size()); |
|
|
1131 |
StringBuffer buffer = null; |
| 1125 |
while (iter.hasNext()) { |
1132 |
while (iter.hasNext()) { |
| 1126 |
Map.Entry entry = (Map.Entry) iter.next(); |
1133 |
entry = (Map.Entry) iter.next(); |
| 1127 |
StringBuffer buffer= new StringBuffer((String) entry.getKey()); |
1134 |
buffer = new StringBuffer((String) entry.getKey()); |
| 1128 |
buffer.append('=').append((String) entry.getValue()); |
1135 |
buffer.append('=').append((String) entry.getValue()); |
| 1129 |
strings.add(buffer.toString()); |
1136 |
strings.add(buffer.toString()); |
| 1130 |
} |
1137 |
} |
|
Lines 1215-1222
Link Here
|
| 1215 |
public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException { |
1222 |
public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException { |
| 1216 |
Iterator iter = getAllLaunchConfigurations().iterator(); |
1223 |
Iterator iter = getAllLaunchConfigurations().iterator(); |
| 1217 |
List configs = new ArrayList(); |
1224 |
List configs = new ArrayList(); |
|
|
1225 |
ILaunchConfiguration config = null; |
| 1218 |
while (iter.hasNext()) { |
1226 |
while (iter.hasNext()) { |
| 1219 |
ILaunchConfiguration config = (ILaunchConfiguration)iter.next(); |
1227 |
config = (ILaunchConfiguration)iter.next(); |
| 1220 |
if (config.getType().equals(type)) { |
1228 |
if (config.getType().equals(type)) { |
| 1221 |
configs.add(config); |
1229 |
configs.add(config); |
| 1222 |
} |
1230 |
} |
|
Lines 1224-1230
Link Here
|
| 1224 |
return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]); |
1232 |
return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]); |
| 1225 |
} |
1233 |
} |
| 1226 |
|
1234 |
|
| 1227 |
|
|
|
| 1228 |
/** |
1235 |
/** |
| 1229 |
* Returns all launch configurations that are stored as resources |
1236 |
* Returns all launch configurations that are stored as resources |
| 1230 |
* in the given project. |
1237 |
* in the given project. |
|
Lines 1236-1244
Link Here
|
| 1236 |
protected List getLaunchConfigurations(IProject project) { |
1243 |
protected List getLaunchConfigurations(IProject project) { |
| 1237 |
Iterator iter = getAllLaunchConfigurations().iterator(); |
1244 |
Iterator iter = getAllLaunchConfigurations().iterator(); |
| 1238 |
List configs = new ArrayList(); |
1245 |
List configs = new ArrayList(); |
|
|
1246 |
ILaunchConfiguration config = null; |
| 1247 |
IFile file = null; |
| 1239 |
while (iter.hasNext()) { |
1248 |
while (iter.hasNext()) { |
| 1240 |
ILaunchConfiguration config = (ILaunchConfiguration)iter.next(); |
1249 |
config = (ILaunchConfiguration)iter.next(); |
| 1241 |
IFile file = config.getFile(); |
1250 |
file = config.getFile(); |
| 1242 |
if (file != null && file.getProject().equals(project)) { |
1251 |
if (file != null && file.getProject().equals(project)) { |
| 1243 |
configs.add(config); |
1252 |
configs.add(config); |
| 1244 |
} |
1253 |
} |
|
Lines 1276-1291
Link Here
|
| 1276 |
} |
1285 |
} |
| 1277 |
} |
1286 |
} |
| 1278 |
|
1287 |
|
| 1279 |
/* (non-Javadoc) |
1288 |
/**) |
| 1280 |
* @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String) |
1289 |
* @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String) |
|
|
1290 |
* @deprecated launch modes are removed for 3.3M3 in favour of launching with options |
| 1281 |
*/ |
1291 |
*/ |
| 1282 |
public ILaunchMode getLaunchMode(String mode) { |
1292 |
public ILaunchMode getLaunchMode(String mode) { |
| 1283 |
initializeLaunchModes(); |
1293 |
initializeLaunchModes(); |
| 1284 |
return (ILaunchMode) fLaunchModes.get(mode); |
1294 |
return (ILaunchMode) fLaunchModes.get(mode); |
| 1285 |
} |
1295 |
} |
| 1286 |
|
1296 |
|
| 1287 |
/* (non-Javadoc) |
1297 |
/** |
| 1288 |
* @see org.eclipse.debug.core.ILaunchManager#getLaunchModes() |
1298 |
* @see org.eclipse.debug.core.ILaunchManager#getLaunchModes() |
|
|
1299 |
* @deprecated launch modes are removed for 3.3M3 in favour of launching with options |
| 1289 |
*/ |
1300 |
*/ |
| 1290 |
public ILaunchMode[] getLaunchModes() { |
1301 |
public ILaunchMode[] getLaunchModes() { |
| 1291 |
initializeLaunchModes(); |
1302 |
initializeLaunchModes(); |
|
Lines 1309-1315
Link Here
|
| 1309 |
Collection col = fLaunchOptions.values(); |
1320 |
Collection col = fLaunchOptions.values(); |
| 1310 |
return (ILaunchOption[])col.toArray(new ILaunchOption[col.size()]); |
1321 |
return (ILaunchOption[])col.toArray(new ILaunchOption[col.size()]); |
| 1311 |
} |
1322 |
} |
| 1312 |
|
1323 |
|
|
|
1324 |
/** |
| 1325 |
* Initializes the listing of registered launch options. Does no work if the mapping is already populated. |
| 1326 |
* @since 3.3 |
| 1327 |
*/ |
| 1328 |
private synchronized void initializeLaunchOptions() { |
| 1329 |
if(fLaunchOptions == null) { |
| 1330 |
try { |
| 1331 |
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS); |
| 1332 |
IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); |
| 1333 |
fLaunchOptions = new HashMap(); |
| 1334 |
ILaunchOption option = null; |
| 1335 |
for(int i = 0; i < infos.length; i++) { |
| 1336 |
option = new LaunchOption(infos[i]); |
| 1337 |
fLaunchOptions.put(option.getIdentifier(), option); |
| 1338 |
} |
| 1339 |
} |
| 1340 |
catch(CoreException ce) {DebugPlugin.log(ce);} |
| 1341 |
} |
| 1342 |
} |
| 1343 |
|
| 1344 |
/** |
| 1345 |
* @return the listing of launch delegates available to the launching framework |
| 1346 |
* @since 3.3 |
| 1347 |
*/ |
| 1348 |
public ILaunchDelegate[] getLaunchDelegates() { |
| 1349 |
initializeLaunchDelegates(); |
| 1350 |
Collection col = fLaunchDelegates.values(); |
| 1351 |
return (ILaunchDelegate[]) col.toArray(new ILaunchDelegate[col.size()]); |
| 1352 |
} |
| 1353 |
|
| 1354 |
/** |
| 1355 |
* Finds a launch delegate associated with the specified id. For backwards compatibility id can be either |
| 1356 |
* the id provided in a <code>launchDelegates</code> contribution, or the id provided in a |
| 1357 |
* <code>launchConfigurationTypes</code> contribution. |
| 1358 |
* @param configtypeId the id of the delegate to search for |
| 1359 |
* @return the <code>ILaunchDelegate</code> associated with the specifed id or <code>null</code> if no |
| 1360 |
* mapping exists |
| 1361 |
* @since 3.3 |
| 1362 |
*/ |
| 1363 |
public ILaunchDelegate getLaunchDelegate(String id) { |
| 1364 |
initializeLaunchDelegates(); |
| 1365 |
return (ILaunchDelegate) fLaunchDelegates.get(id); |
| 1366 |
} |
| 1367 |
|
| 1368 |
/** |
| 1369 |
* Initializes the listing of delegates available to the launching framework |
| 1370 |
* @since 3.3 |
| 1371 |
*/ |
| 1372 |
private synchronized void initializeLaunchDelegates() { |
| 1373 |
if(fLaunchDelegates == null) { |
| 1374 |
fLaunchDelegates = new HashMap(); |
| 1375 |
//get all launch delegate contributions |
| 1376 |
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES); |
| 1377 |
IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); |
| 1378 |
ILaunchDelegate delegate = null; |
| 1379 |
for(int i = 0; i < infos.length; i++) { |
| 1380 |
delegate = new LaunchDelegate(infos[i]); |
| 1381 |
fLaunchDelegates.put(delegate.getIdentifier(), delegate); |
| 1382 |
} |
| 1383 |
//get all delegates from launch configuration type contributions |
| 1384 |
extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES); |
| 1385 |
infos = extensionPoint.getConfigurationElements(); |
| 1386 |
for(int i = 0; i < infos.length; i++) { |
| 1387 |
//must check to see if delegate is provided in contribution |
| 1388 |
if(infos[i].getAttribute("delegate") != null) { //$NON-NLS-1$ |
| 1389 |
delegate = new LaunchDelegate(infos[i]); |
| 1390 |
fLaunchDelegates.put(delegate.getIdentifier(), delegate); |
| 1391 |
} |
| 1392 |
} |
| 1393 |
} |
| 1394 |
} |
| 1395 |
|
| 1313 |
/** |
1396 |
/** |
| 1314 |
* Returns all launch configurations that are stored locally. |
1397 |
* Returns all launch configurations that are stored locally. |
| 1315 |
* |
1398 |
* |
|
Lines 1397-1405
Link Here
|
| 1397 |
if (Platform.getOS().equals(Constants.OS_WIN32)) { |
1480 |
if (Platform.getOS().equals(Constants.OS_WIN32)) { |
| 1398 |
fgNativeEnv= new HashMap(); |
1481 |
fgNativeEnv= new HashMap(); |
| 1399 |
Iterator entries = casePreserved.entrySet().iterator(); |
1482 |
Iterator entries = casePreserved.entrySet().iterator(); |
|
|
1483 |
Map.Entry entry = null; |
| 1484 |
String key = null; |
| 1400 |
while (entries.hasNext()) { |
1485 |
while (entries.hasNext()) { |
| 1401 |
Map.Entry entry = (Entry) entries.next(); |
1486 |
entry = (Entry) entries.next(); |
| 1402 |
String key = ((String)entry.getKey()).toUpperCase(); |
1487 |
key = ((String)entry.getKey()).toUpperCase(); |
| 1403 |
fgNativeEnv.put(key, entry.getValue()); |
1488 |
fgNativeEnv.put(key, entry.getValue()); |
| 1404 |
} |
1489 |
} |
| 1405 |
} else { |
1490 |
} else { |
|
Lines 1425-1434
Link Here
|
| 1425 |
*/ |
1510 |
*/ |
| 1426 |
public IProcess[] getProcesses() { |
1511 |
public IProcess[] getProcesses() { |
| 1427 |
synchronized (fLaunches) { |
1512 |
synchronized (fLaunches) { |
| 1428 |
List allProcesses= new ArrayList(fLaunches.size()); |
1513 |
List allProcesses = new ArrayList(fLaunches.size()); |
| 1429 |
Iterator e= fLaunches.iterator(); |
1514 |
Iterator e = fLaunches.iterator(); |
|
|
1515 |
IProcess[] processes = null; |
| 1430 |
while (e.hasNext()) { |
1516 |
while (e.hasNext()) { |
| 1431 |
IProcess[] processes= ((ILaunch) e.next()).getProcesses(); |
1517 |
processes = ((ILaunch) e.next()).getProcesses(); |
| 1432 |
for (int i= 0; i < processes.length; i++) { |
1518 |
for (int i= 0; i < processes.length; i++) { |
| 1433 |
allProcesses.add(processes[i]); |
1519 |
allProcesses.add(processes[i]); |
| 1434 |
} |
1520 |
} |
|
Lines 1494-1502
Link Here
|
| 1494 |
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS); |
1580 |
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS); |
| 1495 |
IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); |
1581 |
IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); |
| 1496 |
fComparators = new HashMap(infos.length); |
1582 |
fComparators = new HashMap(infos.length); |
|
|
1583 |
IConfigurationElement configurationElement = null; |
| 1584 |
String attr = null; |
| 1497 |
for (int i= 0; i < infos.length; i++) { |
1585 |
for (int i= 0; i < infos.length; i++) { |
| 1498 |
IConfigurationElement configurationElement = infos[i]; |
1586 |
configurationElement = infos[i]; |
| 1499 |
String attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$ |
1587 |
attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$ |
| 1500 |
if (attr != null) { |
1588 |
if (attr != null) { |
| 1501 |
fComparators.put(attr, new LaunchConfigurationComparator(configurationElement)); |
1589 |
fComparators.put(attr, new LaunchConfigurationComparator(configurationElement)); |
| 1502 |
} else { |
1590 |
} else { |
|
Lines 1508-1539
Link Here
|
| 1508 |
} |
1596 |
} |
| 1509 |
} |
1597 |
} |
| 1510 |
} |
1598 |
} |
| 1511 |
|
1599 |
|
| 1512 |
/** |
1600 |
/** |
| 1513 |
* Initializes contributed launch delegates (i.e. delegates contributed |
1601 |
* Initializes the listing of <code>LaunchConfigurationType</code>s. |
| 1514 |
* to an existing launch configuration type). |
|
|
| 1515 |
*/ |
1602 |
*/ |
| 1516 |
private synchronized void initializeContributedDelegates() { |
|
|
| 1517 |
if (fContributedDelegates == null) { |
| 1518 |
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES); |
| 1519 |
IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); |
| 1520 |
fContributedDelegates = new ArrayList(infos.length); |
| 1521 |
for (int i= 0; i < infos.length; i++) { |
| 1522 |
fContributedDelegates.add(new ContributedDelegate(infos[i])); |
| 1523 |
} |
| 1524 |
} |
| 1525 |
} |
| 1526 |
|
| 1527 |
private synchronized void initializeLaunchConfigurationTypes() { |
1603 |
private synchronized void initializeLaunchConfigurationTypes() { |
| 1528 |
if (fLaunchConfigurationTypes == null) { |
1604 |
if (fLaunchConfigurationTypes == null) { |
| 1529 |
hookResourceChangeListener(); |
1605 |
hookResourceChangeListener(); |
| 1530 |
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES); |
1606 |
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES); |
| 1531 |
IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); |
1607 |
IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); |
| 1532 |
fLaunchConfigurationTypes= new ArrayList(infos.length); |
1608 |
fLaunchConfigurationTypes = new ArrayList(infos.length); |
| 1533 |
for (int i= 0; i < infos.length; i++) { |
1609 |
for (int i= 0; i < infos.length; i++) { |
| 1534 |
IConfigurationElement configurationElement = infos[i]; |
1610 |
fLaunchConfigurationTypes.add(new LaunchConfigurationType(infos[i])); |
| 1535 |
LaunchConfigurationType configType = new LaunchConfigurationType(configurationElement); |
|
|
| 1536 |
fLaunchConfigurationTypes.add(configType); |
| 1537 |
} |
1611 |
} |
| 1538 |
} |
1612 |
} |
| 1539 |
} |
1613 |
} |
|
Lines 1543-1548
Link Here
|
| 1543 |
* |
1617 |
* |
| 1544 |
* @exception CoreException if an exception occurs reading |
1618 |
* @exception CoreException if an exception occurs reading |
| 1545 |
* the extensions |
1619 |
* the extensions |
|
|
1620 |
* |
| 1546 |
*/ |
1621 |
*/ |
| 1547 |
private synchronized void initializeLaunchModes() { |
1622 |
private synchronized void initializeLaunchModes() { |
| 1548 |
if (fLaunchModes == null) { |
1623 |
if (fLaunchModes == null) { |
|
Lines 1559-1584
Link Here
|
| 1559 |
catch (CoreException e) {DebugPlugin.log(e);} |
1634 |
catch (CoreException e) {DebugPlugin.log(e);} |
| 1560 |
} |
1635 |
} |
| 1561 |
} |
1636 |
} |
| 1562 |
|
|
|
| 1563 |
/** |
| 1564 |
* Initializes the listing of registered launch options. Does no work if the mapping is already populated. |
| 1565 |
* @since 3.3 |
| 1566 |
*/ |
| 1567 |
private synchronized void initializeLaunchOptions() { |
| 1568 |
if(fLaunchOptions == null) { |
| 1569 |
try { |
| 1570 |
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS); |
| 1571 |
IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); |
| 1572 |
fLaunchOptions = new HashMap(); |
| 1573 |
ILaunchOption option = null; |
| 1574 |
for(int i = 0; i < infos.length; i++) { |
| 1575 |
option = new LaunchOption(infos[i]); |
| 1576 |
fLaunchOptions.put(option.getIdentifier(), option); |
| 1577 |
} |
| 1578 |
} |
| 1579 |
catch(CoreException ce) {DebugPlugin.log(ce);} |
| 1580 |
} |
| 1581 |
} |
| 1582 |
|
1637 |
|
| 1583 |
/** |
1638 |
/** |
| 1584 |
* Initializes source container type and source path computer extensions. |
1639 |
* Initializes source container type and source path computer extensions. |
|
Lines 1615-1623
Link Here
|
| 1615 |
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS); |
1670 |
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS); |
| 1616 |
IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); |
1671 |
IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); |
| 1617 |
fSourceLocators= new HashMap(infos.length); |
1672 |
fSourceLocators= new HashMap(infos.length); |
|
|
1673 |
IConfigurationElement configurationElement = null; |
| 1674 |
String id = null; |
| 1618 |
for (int i= 0; i < infos.length; i++) { |
1675 |
for (int i= 0; i < infos.length; i++) { |
| 1619 |
IConfigurationElement configurationElement = infos[i]; |
1676 |
configurationElement = infos[i]; |
| 1620 |
String id = configurationElement.getAttribute("id"); //$NON-NLS-1$ |
1677 |
id = configurationElement.getAttribute("id"); //$NON-NLS-1$ |
| 1621 |
if (id != null) { |
1678 |
if (id != null) { |
| 1622 |
fSourceLocators.put(id,configurationElement); |
1679 |
fSourceLocators.put(id,configurationElement); |
| 1623 |
} else { |
1680 |
} else { |
|
Lines 1812-1819
Link Here
|
| 1812 |
if (!configs.isEmpty()) { |
1869 |
if (!configs.isEmpty()) { |
| 1813 |
Iterator iterator = configs.iterator(); |
1870 |
Iterator iterator = configs.iterator(); |
| 1814 |
while (iterator.hasNext()) { |
1871 |
while (iterator.hasNext()) { |
| 1815 |
ILaunchConfiguration configuration = (ILaunchConfiguration)iterator.next(); |
1872 |
launchConfigurationDeleted((ILaunchConfiguration)iterator.next()); |
| 1816 |
launchConfigurationDeleted(configuration); |
|
|
| 1817 |
} |
1873 |
} |
| 1818 |
} |
1874 |
} |
| 1819 |
//bug 12134 |
1875 |
//bug 12134 |
|
Lines 1832-1839
Link Here
|
| 1832 |
if (!configs.isEmpty()) { |
1888 |
if (!configs.isEmpty()) { |
| 1833 |
Iterator iterator = configs.iterator(); |
1889 |
Iterator iterator = configs.iterator(); |
| 1834 |
while (iterator.hasNext()) { |
1890 |
while (iterator.hasNext()) { |
| 1835 |
ILaunchConfiguration config = (ILaunchConfiguration) iterator.next(); |
1891 |
launchConfigurationAdded((ILaunchConfiguration) iterator.next()); |
| 1836 |
launchConfigurationAdded(config); |
|
|
| 1837 |
} |
1892 |
} |
| 1838 |
} |
1893 |
} |
| 1839 |
} |
1894 |
} |
|
Lines 1953-1960
Link Here
|
| 1953 |
fLaunchesListeners = new ListenerList(); |
2008 |
fLaunchesListeners = new ListenerList(); |
| 1954 |
fLaunchConfigurationListeners = new ListenerList(); |
2009 |
fLaunchConfigurationListeners = new ListenerList(); |
| 1955 |
ILaunch[] launches = getLaunches(); |
2010 |
ILaunch[] launches = getLaunches(); |
|
|
2011 |
ILaunch launch = null; |
| 1956 |
for (int i= 0; i < launches.length; i++) { |
2012 |
for (int i= 0; i < launches.length; i++) { |
| 1957 |
ILaunch launch= launches[i]; |
2013 |
launch = launches[i]; |
| 1958 |
try { |
2014 |
try { |
| 1959 |
if (launch instanceof IDisconnect) { |
2015 |
if (launch instanceof IDisconnect) { |
| 1960 |
IDisconnect disconnect = (IDisconnect)launch; |
2016 |
IDisconnect disconnect = (IDisconnect)launch; |
|
Lines 2014-2021
Link Here
|
| 2014 |
*/ |
2070 |
*/ |
| 2015 |
protected void verifyConfigurations(List verify, List valid) { |
2071 |
protected void verifyConfigurations(List verify, List valid) { |
| 2016 |
Iterator configs = verify.iterator(); |
2072 |
Iterator configs = verify.iterator(); |
|
|
2073 |
ILaunchConfiguration config = null; |
| 2017 |
while (configs.hasNext()) { |
2074 |
while (configs.hasNext()) { |
| 2018 |
ILaunchConfiguration config = (ILaunchConfiguration)configs.next(); |
2075 |
config = (ILaunchConfiguration)configs.next(); |
| 2019 |
if (isValid(config)) { |
2076 |
if (isValid(config)) { |
| 2020 |
valid.add(config); |
2077 |
valid.add(config); |
| 2021 |
} |
2078 |
} |