1 11 package org.eclipse.pde.internal.ui.launcher; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.debug.core.ILaunchConfiguration; 15 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; 16 import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; 17 import org.eclipse.debug.ui.CommonTab; 18 import org.eclipse.debug.ui.EnvironmentTab; 19 import org.eclipse.debug.ui.ILaunchConfigurationDialog; 20 import org.eclipse.debug.ui.ILaunchConfigurationTab; 21 import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; 22 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; 23 import org.eclipse.pde.internal.core.PDECore; 24 import org.eclipse.swt.custom.BusyIndicator; 25 import org.eclipse.swt.widgets.Display; 26 27 public class WorkbenchLauncherTabGroup extends AbstractLaunchConfigurationTabGroup { 28 29 33 public void createTabs(ILaunchConfigurationDialog dialog, String mode) { 34 ILaunchConfigurationTab[] tabs = null; 35 if (PDECore.getDefault().getModelManager().isOSGiRuntime()) { 36 tabs = new ILaunchConfigurationTab[]{new BasicLauncherTab(), 37 new AdvancedLauncherTab(), new ConfigurationTab(), 38 new TracingLauncherTab(), new EnvironmentTab(), 39 new SourceLookupTab(), new CommonTab()}; 40 } else { 41 tabs = new ILaunchConfigurationTab[]{new BasicLauncherTab(), 42 new AdvancedLauncherTab(), new TracingLauncherTab(), 43 new EnvironmentTab(), new SourceLookupTab(), 44 new CommonTab()}; 45 } 46 setTabs(tabs); 47 } 48 51 public void initializeFrom(ILaunchConfiguration configuration) { 52 final ILaunchConfiguration config = configuration; 53 final ILaunchConfigurationTab[] tabs = getTabs(); 54 BusyIndicator.showWhile(Display.getCurrent(), new Runnable () { 55 public void run() { 56 try { 57 String id = 58 config.getAttribute( 59 IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, 60 (String ) null); 61 if (id == null 62 && config instanceof ILaunchConfigurationWorkingCopy) { 63 ILaunchConfigurationWorkingCopy wc = 64 (ILaunchConfigurationWorkingCopy) config; 65 wc.setAttribute( 66 IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, 67 "org.eclipse.pde.ui.workbenchClasspathProvider"); } 69 } catch (CoreException e) { 70 } 71 for (int i = 0; i < tabs.length; i++) { 72 tabs[i].initializeFrom(config); 73 } 74 } 75 }); 76 } 77 78 81 public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { 82 super.setDefaults(configuration); 83 configuration.setAttribute( 84 IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, 85 "org.eclipse.pde.ui.workbenchClasspathProvider"); } 87 88 } 89 | Popular Tags |