removed unnecessary context launch stuff and fixed up some warnings.
authorwpaul
Wed, 03 Jun 2009 16:47:03 -0500
changeset 202 4eeba852ae0b
parent 201 42aa6ce7b5d0
child 203 e2002a613358
removed unnecessary context launch stuff and fixed up some warnings.
debuggercdi/com.nokia.cdt.debug.launch/plugin.xml
debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/ContextConfigurationTabGroup.java
debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/ContextMainTab.java
--- a/debuggercdi/com.nokia.cdt.debug.launch/plugin.xml	Wed Jun 03 16:37:48 2009 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.launch/plugin.xml	Wed Jun 03 16:47:03 2009 -0500
@@ -5,16 +5,6 @@
    <extension
          point="org.eclipse.debug.core.launchConfigurationTypes">
 
-     <launchConfigurationType
-            sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
-            sourcePathComputerId="com.nokia.cdt.debug.cw.symbian.CarbideSourcePathComputer"
-            name="Symbian OS Application"
-            delegate="com.nokia.cdt.internal.debug.launch.ContextLaunchDelegate"
-            modes="run,debug"
-            public="true"
-            id="com.nokia.cdt.debug.launch.contextLaunch">
-      </launchConfigurationType>
-
       <launchConfigurationType
             sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
             sourcePathComputerId="com.nokia.cdt.debug.cw.symbian.CarbideSourcePathComputer"
@@ -80,11 +70,6 @@
          point="org.eclipse.debug.ui.launchConfigurationTypeImages">
       <launchConfigurationTypeImage
             icon="icons/launch_config_file_16x16.png"
-            configTypeID="com.nokia.cdt.debug.launch.contextLaunch"
-            id="com.nokia.cdt.debug.launch.contextLaunchImage">
-      </launchConfigurationTypeImage>
-      <launchConfigurationTypeImage
-            icon="icons/launch_config_file_16x16.png"
             configTypeID="com.nokia.cdt.debug.launch.emulationLaunch"
             id="com.nokia.cdt.debug.launch.emulationLaunchImage">
       </launchConfigurationTypeImage>
@@ -120,15 +105,6 @@
    <extension
          point="org.eclipse.debug.ui.launchConfigurationTabGroups">
       <launchConfigurationTabGroup
-            type="com.nokia.cdt.debug.launch.contextLaunch"
-            class="com.nokia.cdt.internal.debug.launch.ui.ContextConfigurationTabGroup"
-            id="com.nokia.cdt.debug.launch.contextLaunchTabGroup">
-      </launchConfigurationTabGroup>
-    </extension>
-
-   <extension
-         point="org.eclipse.debug.ui.launchConfigurationTabGroups">
-      <launchConfigurationTabGroup
             type="com.nokia.cdt.debug.launch.emulationLaunch"
             class="com.nokia.cdt.internal.debug.launch.ui.EmulationConfigurationTabGroup"
             id="com.nokia.cdt.debug.launch.emulationLaunchTabGroup">
@@ -198,7 +174,7 @@
                    <or>
                      <instanceof value="org.eclipse.cdt.core.model.IBinary"/>
                      <instanceof value="org.eclipse.cdt.core.model.ICProject"/>
-                     <instanceof value="com.nokia.cdt.debug.cw.symbian.ui.executables.Executable"/>
+                     <instanceof value="org.eclipse.cdt.debug.core.executables.Executable"/>
                      <test
                            forcePluginActivation="true"
                            property="org.eclipse.cdt.launch.isExecutable"/>
@@ -231,19 +207,10 @@
   		 </contextualLaunch>
          <description
              mode="run"
-             description="Runs a Symbian OS executable on either the emulator or a phone"/>
+             description="Runs a Symbian OS executable"/>
           <description
              mode="debug"
-             description="Debugs a Symbian OS executable on either the emulator or a phone"/>
-         <perspective
-               id="com.nokia.carbide.cpp.CarbideCppPerspective">
-         </perspective>
-         <perspective
-               id="org.eclipse.debug.ui.DebugPerspective">
-         </perspective>
-         <configurationType
-               id="com.nokia.cdt.debug.launch.contextLaunch">
-         </configurationType>
+             description="Debugs a Symbian OS executable"/>
       </shortcut>
      </extension>
    
@@ -271,7 +238,7 @@
 	<extension point="org.eclipse.core.runtime.adapters">
          <factory 
             class="" 
-            adaptableType="com.nokia.cdt.debug.cw.symbian.ui.executables.Executable">
+            adaptableType="org.eclipse.cdt.debug.core.executables.Executable">
             <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
          </factory>
     </extension>
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/ContextConfigurationTabGroup.java	Wed Jun 03 16:37:48 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-package com.nokia.cdt.internal.debug.launch.ui;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-
-import com.nokia.cdt.debug.cw.symbian.SettingsData;
-import com.nokia.cdt.internal.debug.launch.LaunchPlugin;
-
-public class ContextConfigurationTabGroup extends
-		AbstractLaunchConfigurationTabGroup {
-
-	public ContextConfigurationTabGroup() {
-	}
-
-	public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
-		ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
-				new ContextMainTab(),
-			};
-			setTabs(tabs);
-	}
-
-	/**
-	 * Set default for all preferences related to this launch configuration.
-	 * 
-	 * @see ILaunchConfigurationTabGroup#setDefaults(ILaunchConfigurationWorkingCopy)
-	 */
-	public void setDefaults(ILaunchConfigurationWorkingCopy config) {
-		// Call this to make sure options on those CDT common tabs such as "Common"
-		// and "Source" have correct default.
-		super.setDefaults(config);
-
-		// Get the current selected project in C project view.
-		IProject project = LaunchPlugin.getSelectedProject();
-
-		SettingsData.setDefaults(config, SettingsData.LaunchConfig_Context, project);
-	}
-
-}
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/ContextMainTab.java	Wed Jun 03 16:37:48 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,237 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-package com.nokia.cdt.internal.debug.launch.ui;
-
-import java.util.ArrayList;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.ICDescriptor;
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.launch.internal.ui.LaunchImages;
-import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
-import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
-import org.eclipse.cdt.launch.ui.CLaunchConfigurationTab;
-import org.eclipse.cdt.ui.CElementLabelProvider;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-public class ContextMainTab extends CLaunchConfigurationTab {
-
-	private Text thisLaunchUsesText;
-	protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
-	private String filterPlatform = EMPTY_STRING;
-
-	// Project UI widgets
-	protected Label fProjLabel;
-	protected Text fProjText;
-	protected Button fProjButton;
-
-	public void createControl(Composite parent) {
-		Composite comp = new Composite(parent, SWT.NONE);
-		setControl(comp);
-
-		LaunchUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), LaunchTabHelpIds.CONTEXT_MAIN);
-
-		GridLayout topLayout = new GridLayout();
-		comp.setLayout(topLayout);
-
-		createVerticalSpacer(comp, 1);
-		createProjectGroup(comp, 1);
-
-		thisLaunchUsesText = new Text(comp, SWT.WRAP | SWT.READ_ONLY | SWT.MULTI);
-		thisLaunchUsesText.setText(Messages.getString("ContextMainTab.0")); //$NON-NLS-1$
-		final GridData gd_thisLaunchUsesText = new GridData(SWT.FILL, SWT.CENTER, true, false);
-		thisLaunchUsesText.setLayoutData(gd_thisLaunchUsesText);
-		LaunchUIPlugin.setDialogShell(parent.getShell());
-	}
-
-	protected void createProjectGroup(Composite parent, int colSpan) {
-		Composite projComp = new Composite(parent, SWT.NONE);
-		GridLayout projLayout = new GridLayout();
-		projLayout.numColumns = 2;
-		projLayout.marginHeight = 0;
-		projLayout.marginWidth = 0;
-		projComp.setLayout(projLayout);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.horizontalSpan = colSpan;
-		projComp.setLayoutData(gd);
-
-		fProjLabel = new Label(projComp, SWT.NONE);
-		fProjLabel.setText(LaunchMessages.getString("CMainTab.&ProjectColon")); //$NON-NLS-1$
-		gd = new GridData();
-		gd.horizontalSpan = 2;
-		fProjLabel.setLayoutData(gd);
-
-		fProjText = new Text(projComp, SWT.SINGLE | SWT.BORDER);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		fProjText.setLayoutData(gd);
-		fProjText.addModifyListener(new ModifyListener() {
-
-			public void modifyText(ModifyEvent evt) {
-				updateLaunchConfigurationDialog();
-			}
-		});
-
-		fProjButton = createPushButton(projComp, LaunchMessages.getString("Launch.common.Browse_1"), null); //$NON-NLS-1$
-		fProjButton.addSelectionListener(new SelectionAdapter() {
-
-			public void widgetSelected(SelectionEvent evt) {
-				handleProjectButtonSelected();
-				updateLaunchConfigurationDialog();
-			}
-		});
-	}
-
-	/**
-	 * Return an array a ICProject whose platform match that of the runtime env.
-	 */
-	protected ICProject[] getCProjects() throws CModelException {
-		ICProject cproject[] = CoreModel.getDefault().getCModel().getCProjects();
-		ArrayList list = new ArrayList(cproject.length);
-
-		for (int i = 0; i < cproject.length; i++) {
-			ICDescriptor cdesciptor = null;
-			try {
-				cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject)cproject[i].getResource(), false);
-				if (cdesciptor != null) {
-					String projectPlatform = cdesciptor.getPlatform();
-					if (filterPlatform.equals("*") //$NON-NLS-1$
-							|| projectPlatform.equals("*") //$NON-NLS-1$
-							|| filterPlatform.equalsIgnoreCase(projectPlatform) == true) {
-						list.add(cproject[i]);
-					}
-				} else {
-					list.add(cproject[i]);
-				}
-			} catch (CoreException e) {
-				list.add(cproject[i]);
-			}
-		}
-		return (ICProject[])list.toArray(new ICProject[list.size()]);
-	}
-
-	/**
-	 * Realize a C Project selection dialog and return the first selected project, or null if there
-	 * was none.
-	 */
-	protected ICProject chooseCProject() {
-		try {
-			ICProject[] projects = getCProjects();
-
-			ILabelProvider labelProvider = new CElementLabelProvider();
-			ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
-			dialog.setTitle(LaunchMessages.getString("CMainTab.Project_Selection")); //$NON-NLS-1$
-			dialog.setMessage(LaunchMessages.getString("CMainTab.Choose_project_to_constrain_search_for_program")); //$NON-NLS-1$
-			dialog.setElements(projects);
-
-			ICProject cProject = getCProject();
-			if (cProject != null) {
-				dialog.setInitialSelections(new Object[]{cProject});
-			}
-			if (dialog.open() == Window.OK) {
-				return (ICProject)dialog.getFirstResult();
-			}
-		} catch (CModelException e) {
-			LaunchUIPlugin.errorDialog("Launch UI internal error", e); //$NON-NLS-1$			
-		}
-		return null;
-	}
-
-	/**
-	 * Show a dialog that lets the user select a project. This in turn provides context for the main
-	 * type, allowing the user to key a main type name, or constraining the search for main types to
-	 * the specified project.
-	 */
-	protected void handleProjectButtonSelected() {
-		ICProject project = chooseCProject();
-		if (project == null) {
-			return;
-		}
-
-		String projectName = project.getElementName();
-		fProjText.setText(projectName);
-	}
-
-	public String getName() {
-		return "Main"; //$NON-NLS-1$
-	}
-
-	public Image getImage() {
-		return LaunchImages.get(LaunchImages.IMG_VIEW_MAIN_TAB);
-	}
-
-	public void initializeFrom(ILaunchConfiguration configuration) {
-		String projectName = EMPTY_STRING;
-		try {
-			projectName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING);
-		} catch (CoreException ce) {
-			LaunchUIPlugin.log(ce);
-		}
-		fProjText.setText(projectName);
-	}
-
-	/**
-	 * Return the ICProject corresponding to the project name in the project name text field, or
-	 * null if the text does not match a project name.
-	 */
-	protected ICProject getCProject() {
-		String projectName = fProjText.getText().trim();
-		if (projectName.length() < 1) {
-			return null;
-		}
-		return CoreModel.getDefault().getCModel().getCProject(projectName);
-	}
-
-	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
-		ICProject cProject = this.getCProject();
-		if (cProject != null)
-			configuration.setMappedResources(new IResource[] { cProject.getProject() });
-		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText());
-	}
-
-	public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
-		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING);
-		ICElement cElement = null;
-		cElement = getContext(configuration, getPlatform(configuration));
-		if (cElement != null) {
-			initializeCProject(cElement, configuration);
-		}
-	}
-
-}