Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2005, 2007 IBM Corporation and others. |
2 |
* Copyright (c) 2005, 2009 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 7-12
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* EclipseSource Corporation - ongoing enhancements |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
package org.eclipse.pde.internal.ui.wizards.product; |
12 |
package org.eclipse.pde.internal.ui.wizards.product; |
12 |
|
13 |
|
Lines 20-28
Link Here
|
20 |
import org.eclipse.jface.dialogs.Dialog; |
21 |
import org.eclipse.jface.dialogs.Dialog; |
21 |
import org.eclipse.jface.viewers.IStructuredSelection; |
22 |
import org.eclipse.jface.viewers.IStructuredSelection; |
22 |
import org.eclipse.pde.core.plugin.*; |
23 |
import org.eclipse.pde.core.plugin.*; |
23 |
import org.eclipse.pde.internal.ui.IHelpContextIds; |
24 |
import org.eclipse.pde.internal.ui.*; |
24 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
|
|
25 |
import org.eclipse.pde.internal.ui.wizards.PDEWizardNewFileCreationPage; |
25 |
import org.eclipse.pde.internal.ui.wizards.PDEWizardNewFileCreationPage; |
|
|
26 |
import org.eclipse.pde.ui.launcher.EclipseLaunchShortcut; |
27 |
import org.eclipse.pde.ui.launcher.IPDELauncherConstants; |
26 |
import org.eclipse.swt.SWT; |
28 |
import org.eclipse.swt.SWT; |
27 |
import org.eclipse.swt.events.SelectionAdapter; |
29 |
import org.eclipse.swt.events.SelectionAdapter; |
28 |
import org.eclipse.swt.events.SelectionEvent; |
30 |
import org.eclipse.swt.events.SelectionEvent; |
Lines 146-158
Link Here
|
146 |
ArrayList list = new ArrayList(); |
148 |
ArrayList list = new ArrayList(); |
147 |
try { |
149 |
try { |
148 |
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); |
150 |
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); |
149 |
ILaunchConfigurationType type = manager.getLaunchConfigurationType("org.eclipse.pde.ui.RuntimeWorkbench"); //$NON-NLS-1$ |
151 |
ILaunchConfigurationType type = manager.getLaunchConfigurationType(EclipseLaunchShortcut.CONFIGURATION_TYPE); |
150 |
ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); |
152 |
ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); |
151 |
for (int i = 0; i < configs.length; i++) { |
153 |
for (int i = 0; i < configs.length; i++) { |
152 |
if (!DebugUITools.isPrivate(configs[i])) |
154 |
if (!DebugUITools.isPrivate(configs[i])) |
153 |
list.add(configs[i].getName()); |
155 |
list.add(configs[i].getName()); |
154 |
} |
156 |
} |
|
|
157 |
// add osgi launch configs to the list |
158 |
type = manager.getLaunchConfigurationType(IPDELauncherConstants.OSGI_CONFIGURATION_TYPE); |
159 |
configs = manager.getLaunchConfigurations(type); |
160 |
for (int i = 0; i < configs.length; i++) { |
161 |
if (!DebugUITools.isPrivate(configs[i])) |
162 |
list.add(configs[i].getName()); |
163 |
} |
155 |
} catch (CoreException e) { |
164 |
} catch (CoreException e) { |
|
|
165 |
PDEPlugin.logException(e); |
156 |
} |
166 |
} |
157 |
return (String[]) list.toArray(new String[list.size()]); |
167 |
return (String[]) list.toArray(new String[list.size()]); |
158 |
} |
168 |
} |
Lines 164-176
Link Here
|
164 |
String configName = fLaunchConfigCombo.getText(); |
174 |
String configName = fLaunchConfigCombo.getText(); |
165 |
try { |
175 |
try { |
166 |
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); |
176 |
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); |
167 |
ILaunchConfigurationType type = manager.getLaunchConfigurationType("org.eclipse.pde.ui.RuntimeWorkbench"); //$NON-NLS-1$ |
177 |
ILaunchConfigurationType type = manager.getLaunchConfigurationType(EclipseLaunchShortcut.CONFIGURATION_TYPE); |
|
|
178 |
ILaunchConfigurationType type2 = manager.getLaunchConfigurationType(IPDELauncherConstants.OSGI_CONFIGURATION_TYPE); |
168 |
ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); |
179 |
ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); |
169 |
for (int i = 0; i < configs.length; i++) { |
180 |
ILaunchConfiguration[] configs2 = manager.getLaunchConfigurations(type2); |
170 |
if (configs[i].getName().equals(configName) && !DebugUITools.isPrivate(configs[i])) |
181 |
ILaunchConfiguration[] configurations = new ILaunchConfiguration[configs.length + configs2.length]; |
171 |
return configs[i]; |
182 |
System.arraycopy(configs, 0, configurations, 0, configs.length); |
|
|
183 |
System.arraycopy(configs2, 0, configurations, configs.length, configs2.length); |
184 |
for (int i = 0; i < configurations.length; i++) { |
185 |
if (configurations[i].getName().equals(configName) && !DebugUITools.isPrivate(configurations[i])) |
186 |
return configurations[i]; |
172 |
} |
187 |
} |
173 |
} catch (CoreException e) { |
188 |
} catch (CoreException e) { |
|
|
189 |
PDEPlugin.logException(e); |
174 |
} |
190 |
} |
175 |
return null; |
191 |
return null; |
176 |
} |
192 |
} |