Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/.classpath17
-rw-r--r--launch/org.eclipse.cdt.launch/.cvsignore1
-rw-r--r--launch/org.eclipse.cdt.launch/.project39
-rw-r--r--launch/org.eclipse.cdt.launch/ChangeLog281
-rw-r--r--launch/org.eclipse.cdt.launch/about.html30
-rw-r--r--launch/org.eclipse.cdt.launch/build.properties13
-rw-r--r--launch/org.eclipse.cdt.launch/icons/c_app.gifbin862 -> 0 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gifbin108 -> 0 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gifbin166 -> 0 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gifbin198 -> 0 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gifbin152 -> 0 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gifbin157 -> 0 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/plugin.properties17
-rw-r--r--launch/org.eclipse.cdt.launch/plugin.xml95
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java554
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java332
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java112
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java245
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java223
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java39
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java81
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java208
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java35
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java417
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java257
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java182
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java314
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java393
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java133
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java412
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java152
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java183
32 files changed, 0 insertions, 4765 deletions
diff --git a/launch/org.eclipse.cdt.launch/.classpath b/launch/org.eclipse.cdt.launch/.classpath
deleted file mode 100644
index 0bf3d237864..00000000000
--- a/launch/org.eclipse.cdt.launch/.classpath
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="src" path="/org.eclipse.core.resources"/>
- <classpathentry kind="src" path="/org.eclipse.debug.core"/>
- <classpathentry kind="src" path="/org.eclipse.debug.ui"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.core"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.ui"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.debug.core"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.debug.ui"/>
- <classpathentry kind="src" path="/org.apache.xerces"/>
- <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
- <classpathentry kind="src" path="/org.eclipse.core.boot"/>
- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/launch/org.eclipse.cdt.launch/.cvsignore b/launch/org.eclipse.cdt.launch/.cvsignore
deleted file mode 100644
index ba077a4031a..00000000000
--- a/launch/org.eclipse.cdt.launch/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/launch/org.eclipse.cdt.launch/.project b/launch/org.eclipse.cdt.launch/.project
deleted file mode 100644
index c1a7b1fb1b6..00000000000
--- a/launch/org.eclipse.cdt.launch/.project
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.cdt.launch</name>
- <comment></comment>
- <projects>
- <project>org.apache.xerces</project>
- <project>org.eclipse.cdt.core</project>
- <project>org.eclipse.cdt.debug.core</project>
- <project>org.eclipse.cdt.debug.ui</project>
- <project>org.eclipse.cdt.ui</project>
- <project>org.eclipse.core.boot</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.debug.core</project>
- <project>org.eclipse.debug.ui</project>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/launch/org.eclipse.cdt.launch/ChangeLog b/launch/org.eclipse.cdt.launch/ChangeLog
deleted file mode 100644
index ca8ea211e87..00000000000
--- a/launch/org.eclipse.cdt.launch/ChangeLog
+++ /dev/null
@@ -1,281 +0,0 @@
-2003-08-05 Mikhail Khodjaiants
- * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java
- Check if the project saved in the launch configuration equals to the project set
- in the source lookup tab.
-
-2003-07-28 Tom Tromey <tromey@redhat.com>
- * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
- (loadDebuggerComboBox): Sort entries by name. from
-
-2003-07-28 Mikhail Khodjaiants
- * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java
- Refactoring: moved the 'CDebugUtils' class to the 'org.eclipse.cdt.debug.core' package -
- the methods of this class are mostly used in UI plugins.
-
-2003-07-22 David Inglis
- * src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java
- * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
- * src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java
- Refactor getName & getImage up into AbstructCDebuggerTab
- fixed problem with selecting a debugger for a core file from a unknown project platform.
-
-2003-07-22 David Inglis
- * src/org/eclipse/cdt/launch/ui/CMainTab.java
- Use project name for configuration naming when no binary selected
-
-2003-07-22 Mikhail Khodjaiants
- * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java
- * src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java
- Fixed initialization problems.
-
-2003-07-17 Thomas Fletcher
- * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java
- Applied source locator patch to expand the scope of source lookups.
- Patch from Mikhail Khodjaiants
-
-2003-07-09 Thomas Fletcher
- * src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
- Filled out this class which previously wasn't loading images ... now it is.
-
-2003-07-03 David Inglis
- * src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
- * src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
- * src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java
- * src/org/eclipse/cdt/launch/ui/CMainTab.java
- Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=39583
-
-2003-06-26 David Inglis
-
- * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
- Added variable book-keeping option in config.
-
- * src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java (getContext)
- Returns an ICElement even if CDescriptor does not exsist.
-
- * src/org/eclipse/cdt/launch/ui/CMainTab.java
- Use BusyIndicator when getting binary list from project
- fixed problem with prefilling a new config when the project did not have a CDescriptor
-
-
-2003-04-17 Alain Magloire
-
- * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortCut.java:
- fix Typo.
-
-2003-03-27 Alain Magloire
-
- * src/org/eclipse/cdt/launch/ui/CMainTab.java:
- Refactor of ICRoot to ICModel adjust the code.
-
-2003-03-19 David Inglis
- Fixed bug with not showing C Project lists with the launch config, when C UI Plugins was not
- created yet.
-
-2003-03-18 Alain Magloire
-
- * plugin.xml
- * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java:
- Change the texts for "C Local Application".
-
-2003-02-20 Mikhail Khodjaiants
- The generation of launch configuration shouldn't fail if project is not set or project name is empty.
- * DefaultSourceLocator.java
- * CSourceLookupTab.java
-
-2003-02-18 Mikhail Khodjaiants
- New 'Source Lookup' tab.
- * plugin.xml
- Added dependency on the 'org.apache.xerces' plugin and the 'sourceLocator' extension.
- * plugin.properties
- Name for the source locator.
- * CoreFileCLaunchConfigurationTabGroup.java
- * LocalCLaunchConfigurationTabGroup.java
- Added the 'Source Lookup' tab.
- * DefaultSourceLocator.java
- Implementation of 'IPersistableSourceLocator'.
- * CSourceLookupTab.java
- Implementation of 'ILaunchConfiguartionTab'.
-
-2003-02-07 David Inglis
-
- Refactor LaunchConstants into debug.core and make setting source locator happen before
- debug target it created.
-
- * src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
- * src/org/eclipse/cdt/launch/ICDTLaunchConfigurationConstants.java
- * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
- * src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
- * src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java
- * src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java
- * src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java
- * src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
- * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java
- * src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
- * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
- * src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java
- * src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java
- * src/org/eclipse/cdt/launch/ui/CMainTab.java
- * src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java
-
-2003-02-06 Alain Magloire
-
- * src/.../launch/internal/ui/WorkingDirectoryBlock.java (geLaunchConfiguration):
- (updateLaunchConfigurationDialog): New method to change the scope for inner classes.
- * src/.../launch/ui/CArgumentsTab.java (updateLaunchConfigurationDialog):
- New method changing the scope for inner classes.
- * src/.../launch/ui/CDebuggerTab.java (updateLaunchConfigurationDialog):
- New method changing the scope for inner classes.
- * src/.../launch/ui/CMainTab.java (updateLaunchConfigurationDialog):
- New method changing the scope for inner classes.
- * src/.../launch/ui/CorefileDebuggerTab.java (handleDebuggerChange):
- New method changing the scope for inner classes.
-
-
-2003-02-06 David Inglis
- * src/.../launch/internal/CApplicationLaunchShortcut.java
- * src/.../launch/ui/CMainTab.java
- Change to use WorkbenchLabelProvider
-
-2003-01-29 David Inglis
- * src/.../launch/internal/ui/LaunchUIPluging.java (getShell)
- change so that it will always return a shell.
-
-2003-01-28 Alain Magloire
-
- * src/.../launch/internal/CApplicationLaunchShortCut.java (getCLaunchConfigType):
- Change to protected.
-
-2003-01-16 David Inglis
- * src/.../launch/ui/CDebuggerTab.java
- made 'revert' work properly within the debugger tab.
-
-2003-01-16 David Inglis
- * src/.../launch/AbstractCLaunchDelegate.java
- add check for program existance on disk before launch
-
- * src/.../launch/internal/ui/AbstractCDebuggerTab.java
- * src/.../launch/ui/CDebuggerTab.java
- * src/.../launch/ui/CorefileDebuggerTab.java
- Fixed http://bugs.eclipse.org/bugs/show_bug.cgi?id=29532
-
-2003-01-06 Alain Magloire
-
- * build.properties: Patch from Judy Green.
-
-2003-01-06 Alain Magloire
-
- Add support for variable substitution:
- HOME=/foo
- MYHOME=${HOME}/bar
-
- MYHOME --> /foo/bar
-
- Furture work: provide the shell brace expansion.
-
- * src/.../launch/internal/AbstractCLaunchDelegate.java (expandEnvironment):
- Expand variable values containing format ${..}.
- * src/.../launch/internal/LocalCLaunConfiguratDelegate.java (exec):
- Use expandEnvironment().
- (launch): Use expandEnvironment().
-
-2002-12-17 David Inglis
-
- * src/.../launch/AbstractCLaunchDelegate.java(setDefaultSourceLocator): new method
- * src/.../sourcelookup/DefaultSourceLocator.java:new class
- add method for delegate to call to set a default source locator.
-
-2002-12-03 Alain Magloire
-
- * src/.../internal/LocalCLaunchConfigurationDelegate.java(exec):
- Change the signature to take Properties for the environment get
- the default environment and add it to new environment to it.
- Use ProcessFactory to run the Application, with the new environment
- array.
-
-2002-11-23 Alain Magloire
-
- * src/.../internal/ui/CApplicationLaunchShortcut.java (searchAndLaunch):
- Bail out with a message if no binaries.
-
-2002-11-22 Alain Magloire
-
- * src/.../AbstractCLaunchDelegate.java (getProgranName): Now static.
- * src/.../internal/ui/LaunchUIPlugin.java.java (errorDialog): New method.
- * src/.../internal/ui/CApplicationLauchShortcut.java.java : New File
- provides shortcut to start C applications.
- * plugin.xml: Implement extenxion point shortcut.
-
-2002-11-22 Alain Magloire
-
- * src/.../internal/ui/LaunchUIPlugin.java (startup):
- On startup add a listener to DebugPlugin for debug events.
- (shutdown): remove the listener.
- (handleDebugEvents): For Termination events do a refresh on
- the project.
-
-2002-11-21 Alain Magloire
-
- * src/.../internal/ui/WorkingDirectoryBlock.java (setDefaultWorkingDir):
- Set the workspace directory default to be the Project.
- * src/.../internal/LocalCLaunchConfigurationDelegate.java (launch):
- Use the new function getWorkingDirectory(), it does more check by
- calling verifyWorkingDirectory().
- * src/.../AbstractCLaunchDelegate.java (getEnvironmentArray):
- implemented.
- (getWorkingDirectory): New method, call verifyWorkingDirectory();
- (verifyWorkingDirectory): New method, does more checking.
- (getWorkingDir): Deprecated and calls getWorkingDirectory().
- (getWorkingDirectoryPath): New method.
- (getCProject): Now static.
- (getProjectName): Now static
-
-2002-11-21 Judy N. Green
-
- * src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java (verifyCProject):
- If we cannot get the ICProject with the config, we get the project
- and see if it exists and/or it is closed. The appropriate error is now
- displayed, rather than reporting that the project does not exist when it
- does exist, but is closed.
-
-2002-11-14 Thomas Fletcher
- * src/.../launch/ui/CMainTab.java
- Updated error condition to catch closed projects.
-
-2002-11-13 Thomas Fletcher
- * src/.../launch/ui/CDebuggerTab.java
- Updated punctuation.
-
-2002-11-13 David Inglis
- * src/.../launch/ui/CDebuggerTab.java
- * src/.../launch/ui/CLaunchConfigurationTab.java
- * src/.../launch/ui/CorefileDebuggerTab.java
- Added support for supported cpus on a debugger and filters list based on
- selected IBinary.
- Default debugger selection is not the first exact matching debugger for
- the specified platform.
-
-2002-11-06 David Inglis
- * src/.../launch/ui/CMainTab.java
- * src/.../launch/ui/ClaunchCOnfigurationTAb.java
- fixed problem with preselection of project/program for new configurations
-
-2002-11-04 David Inglis
- * src/.../launch/ui/CDebuggerTab.java
- * src/.../launch/ui/CMainTab.java
- change "local" to "native" and support "*" as a wildcard for platform.
-
-2002-11-04 David Inglis
- * src/.../launch/internal/ui/LocalCLaunchCOnfigurationTabGroup.java
- don't filter tab list based on mode since the configuration is shared with debug mode.
-
-2002-11-01 David Inglis
- * src/.../launch/internal/CoreFileLaunchDelegate.java
- * src/.../launch/internal/LocalCLaunchConfigur.ationDelegate.java
- use new newDebugTaget methods in CDebugModel
-
-2002-10-23 David Inglis
-
- * /src/.../launch/internal/CoreFileDelegate.java
- * /src/.../launch/internal/LocalCLaunchConfigurationDelegate.java
- create new IProcess for debug console from CDISession and pass
- to newDebugTarget methods
diff --git a/launch/org.eclipse.cdt.launch/about.html b/launch/org.eclipse.cdt.launch/about.html
deleted file mode 100644
index 293340ea8ed..00000000000
--- a/launch/org.eclipse.cdt.launch/about.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>20th August, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
-other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/launch/org.eclipse.cdt.launch/build.properties b/launch/org.eclipse.cdt.launch/build.properties
deleted file mode 100644
index 90177f3f0f0..00000000000
--- a/launch/org.eclipse.cdt.launch/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-bin.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- about.html
-src.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- about.html
-source.cdtlaunch.jar = src/
-javadoc.packages = org.eclipse.cdt.launch.ui.*,\
- org.eclipse.cdt.launch.sourcelookup*,\
- org.eclipse.cdt.launch.*
-
diff --git a/launch/org.eclipse.cdt.launch/icons/c_app.gif b/launch/org.eclipse.cdt.launch/icons/c_app.gif
deleted file mode 100644
index 67c491f307b..00000000000
--- a/launch/org.eclipse.cdt.launch/icons/c_app.gif
+++ /dev/null
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif
deleted file mode 100644
index 8670a384bd3..00000000000
--- a/launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif
+++ /dev/null
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif
deleted file mode 100644
index 8b4f2340c94..00000000000
--- a/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif
+++ /dev/null
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif
deleted file mode 100644
index 65d63ec00d6..00000000000
--- a/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif
+++ /dev/null
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif
deleted file mode 100644
index 6b86d079780..00000000000
--- a/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif
+++ /dev/null
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif
deleted file mode 100644
index 3976f8f7913..00000000000
--- a/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif
+++ /dev/null
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/plugin.properties b/launch/org.eclipse.cdt.launch/plugin.properties
deleted file mode 100644
index edc1deedb5e..00000000000
--- a/launch/org.eclipse.cdt.launch/plugin.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-######################################################################
-# Copyright (c) 2002 QNX Software Systems Ltd. and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v0.5
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v05.html
-#
-# Contributors:
-# QNX Software Systems Ltd. - Initial implementation
-######################################################################
-pluginName=C/C++ Development Tools Launching Support
-providerName=Eclipse.org
-
-LocalCDTLaunch.name= C/C++ Local
-CoreFileCDTLaunch.name= C/C++ Postmortem debugger
-
-DefaultSourceLocator.name=Default C/C++ Source Locator
diff --git a/launch/org.eclipse.cdt.launch/plugin.xml b/launch/org.eclipse.cdt.launch/plugin.xml
deleted file mode 100644
index b7f7e02d9ba..00000000000
--- a/launch/org.eclipse.cdt.launch/plugin.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin
- id="org.eclipse.cdt.launch"
- name="%pluginName"
- version="1.1.0"
- provider-name="%providerName"
- class="org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin">
-
- <runtime>
- <library name="cdtlaunch.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.cdt.core"/>
- <import plugin="org.eclipse.cdt.ui"/>
- <import plugin="org.eclipse.cdt.debug.core"/>
- <import plugin="org.eclipse.cdt.debug.ui"/>
- <import plugin="org.apache.xerces"/>
- </requires>
-
-
- <extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- name="%LocalCDTLaunch.name"
- delegate="org.eclipse.cdt.launch.internal.LocalCLaunchConfigurationDelegate"
- modes="run,debug"
- public="true"
- id="org.eclipse.cdt.launch.localCLaunch">
- </launchConfigurationType>
- <launchConfigurationType
- name="%CoreFileCDTLaunch.name"
- delegate="org.eclipse.cdt.launch.internal.CoreFileLaunchDelegate"
- modes="debug"
- public="true"
- id="org.eclipse.cdt.launch.coreFileCLaunch">
- </launchConfigurationType>
- </extension>
- <extension
- point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage
- icon="icons/c_app.gif"
- configTypeID="org.eclipse.cdt.launch.localCLaunch"
- id="org.eclipse.cdt.launch.localCLaunchImage">
- </launchConfigurationTypeImage>
- <launchConfigurationTypeImage
- icon="icons/c_app.gif"
- configTypeID="org.eclipse.cdt.launch.coreFileCLaunch"
- id="org.eclipse.cdt.launch.coreFileCLaunchImage">
- </launchConfigurationTypeImage>
- </extension>
- <extension
- point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- type="org.eclipse.cdt.launch.localCLaunch"
- class="org.eclipse.cdt.launch.internal.ui.LocalCLaunchConfigurationTabGroup"
- id="org.eclipse.cdt.launch.localClaunchConfigurationTabGroup">
- </launchConfigurationTabGroup>
- <launchConfigurationTabGroup
- type="org.eclipse.cdt.launch.coreFileCLaunch"
- class="org.eclipse.cdt.launch.internal.ui.CoreFileCLaunchConfigurationTabGroup"
- id="org.eclipse.cdt.launch.voreFileCLaunchTabGroup">
- </launchConfigurationTabGroup>
- </extension>
- <extension
- point="org.eclipse.debug.ui.launchShortcuts">
- <shortcut
- label="C Local Application"
- icon="icons/c_app.gif"
- modes="run, debug"
- class="org.eclipse.cdt.launch.internal.CApplicationLaunchShortcut"
- id="org.eclipse.cdt.debug.ui.localCShortcut">
- <perspective
- id="org.eclipse.cdt.ui.CPerspective">
- </perspective>
- <perspective
- id="org.eclipse.debug.ui.DebugPerspective">
- </perspective>
- </shortcut>
- </extension>
- <extension
- point="org.eclipse.debug.core.sourceLocators">
- <sourceLocator
- name="%DefaultSourceLocator.name"
- class="org.eclipse.cdt.launch.sourcelookup.DefaultSourceLocator"
- id="org.eclipse.cdt.launch.DefaultSourceLocator">
- </sourceLocator>
- </extension>
-
-</plugin>
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
deleted file mode 100644
index 112f87e745d..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * (c) Copyright QNX Software System Ltd. 2002.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.launch;
-
-import java.io.File;
-import java.text.DateFormat;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Map.Entry;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.*;
-import org.eclipse.cdt.debug.core.CDebugCorePlugin;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
-import org.eclipse.cdt.launch.sourcelookup.DefaultSourceLocator;
-import org.eclipse.cdt.utils.spawner.EnvironmentReader;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
-import org.eclipse.debug.core.model.IPersistableSourceLocator;
-
-abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDelegate {
-
- abstract public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
- throws CoreException;
-
- /**
- * Return the save environment variables in the configuration.
- * The array does not include the default environment of the target.
- * array[n] : name=value
- */
- protected String[] getEnvironmentArray(ILaunchConfiguration config) {
- Map env = null;
- try {
- env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
- }
- catch (CoreException e) {
- }
- if (env == null) {
- return new String[0];
- }
- String[] array = new String[env.size()];
- Iterator entries = env.entrySet().iterator();
- Entry entry;
- for (int i = 0; entries.hasNext() && i < array.length; i++) {
- entry = (Entry) entries.next();
- array[i] = ((String) entry.getKey()) + "=" + ((String) entry.getValue());
- }
- return array;
- }
-
- /**
- * Return the save environment variables of this configuration.
- * The array does not include the default environment of the target.
- */
- protected Properties getEnvironmentProperty(ILaunchConfiguration config) {
- Properties prop = new Properties();
- Map env = null;
- try {
- env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
- } catch (CoreException e) {
- }
- if (env == null)
- return prop;
- Iterator entries = env.entrySet().iterator();
- Entry entry;
- while (entries.hasNext()) {
- entry = (Entry) entries.next();
- prop.setProperty((String) entry.getKey(), (String) entry.getValue());
- }
- return prop;
- }
-
- /**
- * Return the default Environment of the target.
- */
- protected Properties getDefaultEnvironment() {
- return EnvironmentReader.getEnvVars();
- }
-
- /**
- * Expand the variable with the format ${key}. example:
- * HOME=/foobar
- * NEWHOME = ${HOME}/project
- * The environement NEWHOME will be /foobar/project.
- */
- protected Properties expandEnvironment(ILaunchConfiguration config ) {
- return expandEnvironment(getEnvironmentProperty(config));
- }
-
- /**
- * Expand the variable with the format ${key}. example:
- * HOME=/foobar
- * NEWHOME = ${HOME}/project
- * The environement NEWHOME will be /foobar/project.
- */
- protected Properties expandEnvironment(Properties props) {
- Enumeration names = props.propertyNames();
- if (names != null) {
- while (names.hasMoreElements()) {
- String key = (String) names.nextElement();
- String value = props.getProperty(key);
- if (value != null && value.indexOf('$') != -1) {
- StringBuffer sb = new StringBuffer();
- StringBuffer param = new StringBuffer();
- char prev = '\n';
- char ch = prev;
- boolean inMacro = false;
- boolean inSingleQuote = false;
-
- for (int i = 0; i < value.length(); i++) {
- ch = value.charAt(i);
- switch (ch) {
- case '\'':
- if (prev != '\\') {
- inSingleQuote = !inSingleQuote;
- }
- break;
-
- case '$' :
- if (!inSingleQuote && prev != '\\') {
- if (i < value.length() && value.indexOf('}', i) > 0) {
- char c = value.charAt(i + 1);
- if (c == '{') {
- param.setLength(0);
- inMacro = true;
- prev = ch;
- continue;
- }
- }
- }
- break;
-
- case '}' :
- if (inMacro) {
- inMacro = false;
- String v = null;
- String p = param.toString();
- /* Search in the current property only
- * if it is not the same name.
- */
- if (!p.equals(key)) {
- v = props.getProperty(p);
- }
- /* Fallback to the default Environemnt. */
- if (v == null) {
- Properties def = getDefaultEnvironment();
- if (def != null) {
- v = def.getProperty(p);
- }
- }
- if (v != null) {
- sb.append(v);
- }
- param.setLength(0);
- /* Skip the trailing } */
- prev = ch;
- continue;
- }
- break;
- } /* switch */
-
- if (!inMacro) {
- sb.append(ch);
- } else {
- /* Do not had the '{' */
- if (!(ch == '{' && prev == '$')) {
- param.append(ch);
- }
- }
- prev = (ch == '\\' && prev == '\\') ? '\n' : ch;
- } /* for */
- props.setProperty(key, sb.toString());
- } /* !if (value ..) */
- } /* while() */
- } /* if (names != null) */
- return props;
- }
-
- /**
- * Returns the working directory specified by
- * the given launch configuration, or <code>null</code> if none.
- *
- * @deprecated Should use getWorkingDirectory()
- * @param configuration launch configuration
- * @return the working directory specified by the given
- * launch configuration, or <code>null</code> if none
- * @exception CoreException if unable to retrieve the attribute
- */
- public File getWorkingDir(ILaunchConfiguration configuration) throws CoreException {
- return getWorkingDirectory(configuration);
- }
-
- /**
- * Returns the working directory specified by
- * the given launch configuration, or <code>null</code> if none.
- *
- * @param configuration launch configuration
- * @return the working directory specified by the given
- * launch configuration, or <code>null</code> if none
- * @exception CoreException if unable to retrieve the attribute
- */
- public File getWorkingDirectory(ILaunchConfiguration configuration) throws CoreException {
- return verifyWorkingDirectory(configuration);
- }
-
- protected IPath getWorkingDirectoryPath(ILaunchConfiguration config) throws CoreException {
- String path = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
- if (path != null) {
- return new Path(path);
- }
- return null;
- }
-
- /**
- * Throws a core exception with an error status object built from
- * the given message, lower level exception, and error code.
- *
- * @param message the status message
- * @param exception lower level exception associated with the
- * error, or <code>null</code> if none
- * @param code error code
- */
- protected void abort(String message, Throwable exception, int code) throws CoreException {
- String newMessage = message;
- if (exception != null) {
- newMessage = message + " : " + exception.getLocalizedMessage();
- }
- throw new CoreException(new Status(IStatus.ERROR, getPluginID(), code, newMessage, exception));
- }
-
- protected void cancel(String message, int code) throws CoreException {
- throw new CoreException(new Status(IStatus.OK, getPluginID(), code, message, null));
- }
-
- abstract protected String getPluginID();
-
- public static ICProject getCProject(ILaunchConfiguration configuration) throws CoreException {
- String projectName = getProjectName(configuration);
- if (projectName != null) {
- projectName = projectName.trim();
- if (projectName.length() > 0) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project);
- if (cProject != null && cProject.exists()) {
- return cProject;
- }
- }
- }
- return null;
- }
-
- public static String getProjectName(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
- }
-
- public static String getProgramName(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) null);
- }
-
- /**
- * Assigns a default source locator to the given launch if a source locator has not yet been assigned to it, and the associated
- * launch configuration does not specify a source locator.
- *
- * @param launch launch object
- * @param configuration configuration being launched
- * @exception CoreException if unable to set the source locator
- */
- protected void setSourceLocator(ILaunch launch, ILaunchConfiguration configuration) throws CoreException {
- // set default source locator if none specified
- if (launch.getSourceLocator() == null) {
- IPersistableSourceLocator sourceLocator;
- String id = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String) null);
- if (id == null) {
- ICProject cProject = getCProject(configuration);
- if (cProject == null) {
- abort("Project does not exist", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
- }
- sourceLocator = new DefaultSourceLocator();
- sourceLocator.initializeDefaults(configuration);
- } else {
- sourceLocator = DebugPlugin.getDefault().getLaunchManager().newSourceLocator(id);
- String memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
- if (memento == null) {
- sourceLocator.initializeDefaults(configuration);
- } else {
- sourceLocator.initializeFromMemento(memento);
- }
- }
- launch.setSourceLocator(sourceLocator);
- }
- }
-
- /**
- * Returns the program arguments as a String.
- *
- * @return the program arguments as a String
- */
- public String getProgramArguments(ILaunchConfiguration config) throws CoreException {
- return config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null);
-
- }
- /**
- * Returns the program arguments as an array of individual arguments.
- *
- * @return the program arguments as an array of individual arguments
- */
- public String[] getProgramArgumentsArray(ILaunchConfiguration config) throws CoreException {
- return parseArguments(getProgramArguments(config));
- }
-
- private static String[] parseArguments(String args) {
- if (args == null)
- return new String[0];
- ArgumentParser parser = new ArgumentParser(args);
- String[] res = parser.parseArguments();
-
- return res;
- }
-
- protected ICDebugConfiguration getDebugConfig(ILaunchConfiguration config) throws CoreException {
- ICDebugConfiguration dbgCfg = null;
- try {
- dbgCfg =
- CDebugCorePlugin.getDefault().getDebugConfiguration(
- config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, ""));
- }
- catch (CoreException e) {
- IStatus status =
- new Status(
- IStatus.ERROR,
- LaunchUIPlugin.getUniqueIdentifier(),
- ICDTLaunchConfigurationConstants.ERR_DEBUGGER_NOT_INSTALLED,
- "CDT Debubger not installed",
- e);
- IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status);
-
- if (handler != null) {
- Object result = handler.handleStatus(status, this);
- if (result instanceof String) {
- // this could return the new debugger id to use?
- }
- }
- throw e;
- }
- return dbgCfg;
- }
-
- protected String renderTargetLabel(ICDebugConfiguration debugConfig) {
- String format = "{0} ({1})";
- String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
- return MessageFormat.format(format, new String[] { debugConfig.getName(), timestamp });
- }
-
- protected String renderProcessLabel(String commandLine) {
- String format = "{0} ({1})";
- String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
- return MessageFormat.format(format, new String[] { commandLine, timestamp });
- }
-
- protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException {
- String name = getProjectName(config);
- if (name == null) {
- abort("C project not specified", null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT);
- }
- ICProject cproject = getCProject(config);
- if (cproject == null) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- if (!project.exists()) {
- abort("Project does not exist", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
- }
- else if (!project.isOpen()) {
- abort("Project is closed", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
- }
- abort("Project is not a C/C++ project", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
- }
- return cproject;
- }
-
- protected IFile getProgramFile(ILaunchConfiguration config) throws CoreException {
- ICProject cproject = verifyCProject(config);
- String fileName = getProgramName(config);
- if (fileName == null) {
- abort("Program file not specified", null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM);
- }
-
- IFile programPath = ((IProject) cproject.getResource()).getFile(fileName);
- if (programPath == null || !programPath.exists() || !programPath.getLocation().toFile().exists()) {
- abort("Program file does not exist", null, ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
- }
- return programPath;
- }
-
- protected IPath verifyProgramFile(ILaunchConfiguration config) throws CoreException {
- return getProgramFile(config).getLocation();
- }
-
- /**
- * Verifies the working directory specified by the given
- * launch configuration exists, and returns the working
- * directory, or <code>null</code> if none is specified.
- *
- * @param configuration launch configuration
- * @return the working directory specified by the given
- * launch configuration, or <code>null</code> if none
- * @exception CoreException if unable to retrieve the attribute
- */
- public File verifyWorkingDirectory(ILaunchConfiguration configuration) throws CoreException {
- IPath path = getWorkingDirectoryPath(configuration);
- if (path == null) {
- // default working dir is the project if this config has a project
- ICProject cp = getCProject(configuration);
- if (cp != null) {
- IProject p = cp.getProject();
- return p.getLocation().toFile();
- }
- }
- else {
- if (path.isAbsolute()) {
- File dir = new File(path.toOSString());
- if (dir.isDirectory()) {
- return dir;
- }
- else {
- abort(
- "Working directory does not exist",
- null,
- ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
- }
- }
- else {
- IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
- if (res instanceof IContainer && res.exists()) {
- return res.getLocation().toFile();
- }
- else {
- abort(
- "Working directory does not exist",
- null,
- ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
- }
- }
- }
- return null;
- }
-
- private static class ArgumentParser {
- private String fArgs;
- private int fIndex = 0;
- private int ch = -1;
-
- public ArgumentParser(String args) {
- fArgs = args;
- }
-
- public String[] parseArguments() {
- ArrayList v = new ArrayList();
-
- ch = getNext();
- while (ch > 0) {
- while (Character.isWhitespace((char) ch))
- ch = getNext();
-
- if (ch == '"') {
- v.add(parseString());
- }
- else {
- v.add(parseToken());
- }
- }
-
- String[] result = new String[v.size()];
- v.toArray(result);
- return result;
- }
-
- private int getNext() {
- if (fIndex < fArgs.length())
- return fArgs.charAt(fIndex++);
- return -1;
- }
-
- private String parseString() {
- StringBuffer buf = new StringBuffer();
- ch = getNext();
- while (ch > 0 && ch != '"') {
- if (ch == '\\') {
- ch = getNext();
- if (ch != '"') { // Only escape double quotes
- buf.append('\\');
- }
- }
- if (ch > 0) {
- buf.append((char) ch);
- ch = getNext();
- }
- }
-
- ch = getNext();
-
- return buf.toString();
- }
-
- private String parseToken() {
- StringBuffer buf = new StringBuffer();
-
- while (ch > 0 && !Character.isWhitespace((char) ch)) {
- if (ch == '\\') {
- ch = getNext();
- if (ch > 0) {
- if (ch != '"') { // Only escape double quotes
- buf.append('\\');
- }
- buf.append((char) ch);
- ch = getNext();
- }
- else if (ch == -1) { // Don't lose a trailing backslash
- buf.append('\\');
- }
- }
- else if (ch == '"') {
- buf.append(parseString());
- }
- else {
- buf.append((char) ch);
- ch = getNext();
- }
- }
- return buf.toString();
- }
- }
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
deleted file mode 100644
index 30b272f9a30..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
+++ /dev/null
@@ -1,332 +0,0 @@
-package org.eclipse.cdt.launch.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.CDebugCorePlugin;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
-import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
-import org.eclipse.cdt.ui.CElementLabelProvider;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchShortcut;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- */
-public class CApplicationLaunchShortcut implements ILaunchShortcut {
-
- /**
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(IEditorPart, String)
- */
- public void launch(IEditorPart editor, String mode) {
- searchAndLaunch(new Object[] { editor.getEditorInput()}, mode);
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(ISelection, String)
- */
- public void launch(ISelection selection, String mode) {
- if (selection instanceof IStructuredSelection) {
- searchAndLaunch(((IStructuredSelection) selection).toArray(), mode);
- }
- }
-
- public void launch(IBinary bin, String mode) {
- try {
- ILaunchConfiguration config = findLaunchConfiguration(bin, mode);
- if (config != null) {
- DebugUITools.saveAndBuildBeforeLaunch();
- config.launch(mode, null);
- }
- } catch (CoreException e) {
- LaunchUIPlugin.errorDialog("Launch failed", e.getStatus()); //$NON-NLS-1$
- }
- }
-
- /**
- * Locate a configuration to relaunch for the given type. If one cannot be found, create one.
- *
- * @return a re-useable config or <code>null</code> if none
- */
- protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) {
- ILaunchConfiguration configuration = null;
- ILaunchConfigurationType configType = getCLaunchConfigType();
- List candidateConfigs = Collections.EMPTY_LIST;
- try {
- ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(configType);
- candidateConfigs = new ArrayList(configs.length);
- for (int i = 0; i < configs.length; i++) {
- ILaunchConfiguration config = configs[i];
- String programName = AbstractCLaunchDelegate.getProgramName(config);
- String projectName = AbstractCLaunchDelegate.getProjectName(config);
- String name = bin.getResource().getProjectRelativePath().toString();
- if (projectName != null && programName.equals(name)) {
- if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) {
- candidateConfigs.add(config);
- }
- }
- }
- } catch (CoreException e) {
- CDebugUIPlugin.log(e);
- }
-
- // If there are no existing configs associated with the IBinary, create one.
- // If there is exactly one config associated with the IBinary, return it.
- // Otherwise, if there is more than one config associated with the IBinary, prompt the
- // user to choose one.
- int candidateCount = candidateConfigs.size();
- if (candidateCount < 1) {
- // FIXME: should probably have more filtering here base on
- // the mode, arch, CPU. For now we only support native.
- // Prompt the user if more then 1 debugger.
- ICDebugConfiguration debugConfig = null;
- ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations();
- List debugList = new ArrayList(debugConfigs.length);
- for (int i = 0; i < debugConfigs.length; i++) {
- String platform = debugConfigs[i].getPlatform();
- if (platform == null || platform.equals("native")) {
- debugList.add(debugConfigs[i]);
- }
- }
- debugConfigs = (ICDebugConfiguration[]) debugList.toArray(new ICDebugConfiguration[0]);
- if (debugConfigs.length == 1) {
- debugConfig = debugConfigs[0];
- } else if (debugConfigs.length > 1) {
- debugConfig = chooseDebugConfig(debugConfigs, mode);
- }
- if (debugConfig != null) {
- configuration = createConfiguration(bin, debugConfig);
- }
- } else if (candidateCount == 1) {
- configuration = (ILaunchConfiguration) candidateConfigs.get(0);
- } else {
- // Prompt the user to choose a config. A null result means the user
- // cancelled the dialog, in which case this method returns null,
- // since cancelling the dialog should also cancel launching anything.
- configuration = chooseConfiguration(candidateConfigs, mode);
- }
- return configuration;
- }
-
- /**
- * Method createConfiguration.
- * @param bin
- * @return ILaunchConfiguration
- */
- private ILaunchConfiguration createConfiguration(IBinary bin, ICDebugConfiguration debugConfig) {
- ILaunchConfiguration config = null;
- try {
- String projectName = bin.getResource().getProjectRelativePath().toString();
- ILaunchConfigurationType configType = getCLaunchConfigType();
- ILaunchConfigurationWorkingCopy wc =
- configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(bin.getElementName()));
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, projectName);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, bin.getCProject().getElementName());
- wc.setAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, IDebugUIConstants.PERSPECTIVE_DEFAULT);
- wc.setAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, IDebugUIConstants.PERSPECTIVE_DEFAULT);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
- wc.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, debugConfig.getID());
- config = wc.doSave();
- } catch (CoreException ce) {
- CDebugUIPlugin.log(ce);
- }
- return config;
- }
-
- /**
- * Method getCLaunchConfigType.
- * @return ILaunchConfigurationType
- */
- protected ILaunchConfigurationType getCLaunchConfigType() {
- return getLaunchManager().getLaunchConfigurationType(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_APP);
- }
-
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Convenience method to get the window that owns this action's Shell.
- */
- protected Shell getShell() {
- return CDebugUIPlugin.getActiveWorkbenchShell();
- }
-
- /**
- * Method chooseDebugConfig.
- * @param debugConfigs
- * @param mode
- * @return ICDebugConfiguration
- */
- private ICDebugConfiguration chooseDebugConfig(ICDebugConfiguration[] debugConfigs, String mode) {
- ILabelProvider provider = new LabelProvider() {
- /**
- * The <code>LabelProvider</code> implementation of this
- * <code>ILabelProvider</code> method returns the element's <code>toString</code>
- * string. Subclasses may override.
- */
- public String getText(Object element) {
- if (element == null) {
- return "";
- } else if (element instanceof ICDebugConfiguration) {
- return ((ICDebugConfiguration) element).getName();
- }
- return element.toString();
- }
- };
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider);
- dialog.setElements(debugConfigs);
- dialog.setTitle("Launch Debug Configuration Selection"); //$NON-NLS-1$
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- dialog.setMessage("Choose a debug configuration to debug"); //$NON-NLS-1$
- } else {
- dialog.setMessage("Choose a configuration to run"); //$NON-NLS-1$
- }
- dialog.setMultipleSelection(false);
- int result = dialog.open();
- provider.dispose();
- if (result == ElementListSelectionDialog.OK) {
- return (ICDebugConfiguration) dialog.getFirstResult();
- }
- return null;
- }
-
- /**
- * Show a selection dialog that allows the user to choose one of the specified
- * launch configurations. Return the chosen config, or <code>null</code> if the
- * user cancelled the dialog.
- */
- protected ILaunchConfiguration chooseConfiguration(List configList, String mode) {
- IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
- dialog.setElements(configList.toArray());
- dialog.setTitle("Launch Configuration Selection"); //$NON-NLS-1$
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- dialog.setMessage("Choose a launch configuration to debug"); //$NON-NLS-1$
- } else {
- dialog.setMessage("Choose a launch configuration to run"); //$NON-NLS-1$
- }
- dialog.setMultipleSelection(false);
- int result = dialog.open();
- labelProvider.dispose();
- if (result == ElementListSelectionDialog.OK) {
- return (ILaunchConfiguration) dialog.getFirstResult();
- }
- return null;
- }
-
- /**
- * Prompts the user to select a binary
- *
- * @return the selected binary or <code>null</code> if none.
- */
- protected IBinary chooseBinary(List binList, String mode) {
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new CElementLabelProvider());
- dialog.setElements(binList.toArray());
- dialog.setTitle("C Local Application"); //$NON-NLS-1$
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- dialog.setMessage("Choose a local application to debug"); //$NON-NLS-1$
- } else {
- dialog.setMessage("Choose a local application to run"); //$NON-NLS-1$
- }
- dialog.setMultipleSelection(false);
- if (dialog.open() == ElementListSelectionDialog.OK) {
- return (IBinary) dialog.getFirstResult();
- }
- return null;
- }
-
- /**
- * Method searchAndLaunch.
- * @param objects
- * @param mode
- */
- private void searchAndLaunch(final Object[] elements, String mode) {
- final List results = new ArrayList();
- if (elements != null && elements.length > 0) {
- try {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor pm) throws InterruptedException {
- int nElements = elements.length;
- pm.beginTask("Looking for executables", nElements); //$NON-NLS-1$
- try {
- IProgressMonitor sub = new SubProgressMonitor(pm, 1);
- for (int i = 0; i < nElements; i++) {
- if (elements[i] instanceof IAdaptable) {
- IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class);
- ICProject cproject = CoreModel.getDefault().create(r.getProject());
- if (cproject != null) {
- IBinary[] bins = cproject.getBinaryContainer().getBinaries();
-
- for (int j = 0; j < bins.length; j++) {
- if (bins[j].isExecutable()) {
- results.add(bins[j]);
- }
- }
- }
- }
- if (pm.isCanceled()) {
- throw new InterruptedException();
- }
- sub.done();
- }
- } finally {
- pm.done();
- }
- }
- };
- dialog.run(true, true, runnable);
- } catch (InterruptedException e) {
- return;
- } catch (InvocationTargetException e) {
- MessageDialog.openError(getShell(), "C Local Application Launcher", e.getMessage());
- return;
- }
- if (results.size() == 0) {
- MessageDialog.openError(getShell(), "C Local Application Launcher", "Launch failed no binaries");
- } else {
- IBinary bin = chooseBinary(results, mode);
- if (bin != null) {
- launch(bin, mode);
- }
- }
- } else {
- MessageDialog.openError(getShell(), "C Local Application Launcher", "Launch failed no project selected");
- }
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
deleted file mode 100644
index e29aab1423a..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.eclipse.cdt.launch.internal;
-
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.CDebugModel;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDISession;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
-import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Insert the type's description here.
- * @see ILaunchConfigurationDelegate
- */
-public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
-
- public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
-
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
-
- monitor.beginTask("Launching postmortem debugger", IProgressMonitor.UNKNOWN);
- // check for cancellation
- if (monitor.isCanceled()) {
- return;
- }
- IFile exeFile = getProgramFile(config);
-
- ICDebugConfiguration debugConfig = getDebugConfig(config);
- ICDISession dsession = null;
- ICProject cproject = getCProject(config);
-
- IPath corefile = getCoreFilePath((IProject) cproject.getResource());
- if (corefile == null) {
- cancel("No Corefile selected", ICDTLaunchConfigurationConstants.ERR_NO_COREFILE);
- }
- Process debugger = null;
- IProcess debuggerProcess = null;
- try {
- dsession = debugConfig.getDebugger().createCoreSession(config, exeFile, corefile);
- debugger = dsession.getSessionProcess();
- } catch (CDIException e) {
- abort("Failed Launching CDI Debugger", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
- }
- if ( debugger != null ) {
- debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console");
- launch.removeProcess(debuggerProcess);
- }
- // set the source locator
- setSourceLocator(launch, config);
-
- CDebugModel.newCoreFileDebugTarget(
- launch,
- dsession.getCurrentTarget(),
- renderTargetLabel(debugConfig),
- debuggerProcess,
- exeFile);
-
- monitor.done();
- }
-
- protected IPath getCoreFilePath(final IProject project) throws CoreException {
- final Shell shell = LaunchUIPlugin.getShell();
- final String res[] = { null };
- if (shell == null) {
- abort("No Shell availible in Launch", null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
- }
- Display display = shell.getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- FileDialog dialog = new FileDialog(shell);
- dialog.setText("Select Corefile");
-
- String initPath = null;
- try {
- initPath = project.getPersistentProperty(new QualifiedName(LaunchUIPlugin.getUniqueIdentifier(), "SavePath"));
- } catch (CoreException e) {
- }
- if (initPath == null || initPath.equals("")) {
- initPath = project.getLocation().toString();
- }
- dialog.setFilterPath(initPath);
- res[0] = dialog.open();
- }
- });
- if (res[0] != null) {
- return new Path(res[0]);
- }
- return null;
- }
-
- public String getPluginID() {
- return LaunchUIPlugin.getUniqueIdentifier();
- }
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java
deleted file mode 100644
index 6f85722e0f8..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java
+++ /dev/null
@@ -1,245 +0,0 @@
-package org.eclipse.cdt.launch.internal;
-
-/*
- * (c) Copyright QNX Software System 2002.
- * All Rights Reserved.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Properties;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.IProcessInfo;
-import org.eclipse.cdt.core.IProcessList;
-import org.eclipse.cdt.debug.core.CDebugModel;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions;
-import org.eclipse.cdt.debug.core.cdi.ICDISession;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
-import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
-import org.eclipse.cdt.utils.spawner.ProcessFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * Insert the type's description here.
- * @see ILaunchConfigurationDelegate
- */
-public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
-
- public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
-
- monitor.beginTask("Launching Local C Application", IProgressMonitor.UNKNOWN);
- // check for cancellation
- if (monitor.isCanceled()) {
- return;
- }
- IFile exeFile = getProgramFile(config);
- String arguments[] = getProgramArgumentsArray(config);
- ArrayList command = new ArrayList(1 + arguments.length);
- command.add(exeFile.getLocation().toOSString());
- command.addAll(Arrays.asList(arguments));
- String[] commandArray = (String[]) command.toArray(new String[command.size()]);
-
- // set the default source locator if required
- setSourceLocator(launch, config);
-
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- IProcess debuggerProcess = null;
- Process debugger;
- ICDebugConfiguration debugConfig = getDebugConfig(config);
- ICDISession dsession = null;
- try {
- String debugMode =
- config.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) {
- dsession = debugConfig.getDebugger().createLaunchSession(config, exeFile);
- ICDIRuntimeOptions opt = dsession.getRuntimeOptions();
- opt.setArguments(getProgramArgumentsArray(config));
- File wd = getWorkingDirectory(config);
- if (wd != null) {
- opt.setWorkingDirectory(wd.getAbsolutePath());
- }
- opt.setEnvironment(expandEnvironment(config));
- ICDITarget dtarget = dsession.getTargets()[0];
- Process process = dtarget.getProcess();
- IProcess iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0]));
- debugger = dsession.getSessionProcess();
- if ( debugger != null ) {
- debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console");
- launch.removeProcess(debuggerProcess);
- }
- boolean stopInMain = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false);
- CDebugModel.newDebugTarget(
- launch,
- dsession.getCurrentTarget(),
- renderTargetLabel(debugConfig),
- iprocess,
- debuggerProcess,
- exeFile,
- true,
- false,
- stopInMain);
-
- } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) {
- int pid = getProcessID();
- if (pid == -1) {
- cancel("No Process ID selected", ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID);
- }
- dsession = debugConfig.getDebugger().createAttachSession(config, exeFile, pid);
- debugger = dsession.getSessionProcess();
- if ( debugger != null ) {
- debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console");
- launch.removeProcess(debuggerProcess);
- }
- CDebugModel.newAttachDebugTarget(
- launch,
- dsession.getCurrentTarget(),
- renderTargetLabel(debugConfig),
- debuggerProcess,
- exeFile);
- }
- } catch (CDIException e) {
- abort("Failed Launching CDI Debugger", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
- }
- } else {
- File wd = getWorkingDirectory(config);
- if (wd == null) {
- wd = new File(System.getProperty("user.home", ".")); //NON-NLS-1;
- }
- Process process = exec(commandArray, getEnvironmentProperty(config), wd);
- DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0]));
- }
-
- monitor.done();
-
- }
-
- private int getProcessID() throws CoreException {
- final Shell shell = LaunchUIPlugin.getShell();
- final int pid[] = { -1 };
- if (shell == null) {
- abort("No Shell availible in Launch", null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
- }
- Display display = shell.getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new LabelProvider() {
- public String getText(Object element) {
- IProcessInfo info = (IProcessInfo) element;
- return info.getPid() + " " + info.getName();
- }
- });
- dialog.setTitle("Select Process");
- dialog.setMessage("Select a Process to attach debugger to:");
- IProcessList plist = CCorePlugin.getDefault().getProcessList();
- if (plist == null) {
- MessageDialog.openError(shell, "CDT Launch Error", "Current platform does not support listing processes");
- return;
- }
- dialog.setElements(plist.getProcessList());
- if (dialog.open() == ElementListSelectionDialog.OK) {
- IProcessInfo info = (IProcessInfo) dialog.getFirstResult();
- if ( info != null ) {
- pid[0] = info.getPid();
- }
- }
- }
- });
- return pid[0];
- }
-
- /**
- * Performs a runtime exec on the given command line in the context
- * of the specified working directory, and returns
- * the resulting process. If the current runtime does not support the
- * specification of a working directory, the status handler for error code
- * <code>ERR_WORKING_DIRECTORY_NOT_SUPPORTED</code> is queried to see if the
- * exec should be re-executed without specifying a working directory.
- *
- * @param cmdLine the command line
- * @param workingDirectory the working directory, or <code>null</code>
- * @return the resulting process or <code>null</code> if the exec is
- * cancelled
- * @see Runtime
- */
- protected Process exec(String[] cmdLine, Properties environ, File workingDirectory) throws CoreException {
- Process p = null;
- Properties props = getDefaultEnvironment();
- props.putAll(expandEnvironment(environ));
- String[] envp = null;
- ArrayList envList = new ArrayList();
- Enumeration names = props.propertyNames();
- if (names != null) {
- while (names.hasMoreElements()) {
- String key = (String) names.nextElement();
- envList.add(key + "=" + props.getProperty(key));
- }
- envp = (String[]) envList.toArray(new String[envList.size()]);
- }
- try {
-
- if (workingDirectory == null) {
- p = ProcessFactory.getFactory().exec(cmdLine, envp);
- } else {
- p = ProcessFactory.getFactory().exec(cmdLine, envp, workingDirectory);
- }
- } catch (IOException e) {
- if (p != null) {
- p.destroy();
- }
- abort("Error starting process", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
- } catch (NoSuchMethodError e) {
- //attempting launches on 1.2.* - no ability to set working directory
-
- IStatus status =
- new Status(
- IStatus.ERROR,
- LaunchUIPlugin.getUniqueIdentifier(),
- ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_NOT_SUPPORTED,
- "Eclipse runtime does not support working directory",
- e);
- IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status);
-
- if (handler != null) {
- Object result = handler.handleStatus(status, this);
- if (result instanceof Boolean && ((Boolean) result).booleanValue()) {
- p = exec(cmdLine, environ, null);
- }
- }
- }
- return p;
- }
-
- protected String getPluginID() {
- return LaunchUIPlugin.getUniqueIdentifier();
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java
deleted file mode 100644
index 0f0ae625317..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * (c) Copyright QNX Software System Ltd. 2002.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.launch.internal.ui;
-
-import java.util.Map;
-
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.cdt.launch.ui.CLaunchConfigurationTab;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
-
- protected ILaunchConfiguration fLaunchConfiguration;
- protected ILaunchConfigurationWorkingCopy fWorkingCopy;
- protected ICDebugConfiguration fCurrentDebugConfig;
-
- // Dynamic Debugger UI widgets
- protected ILaunchConfigurationTab fDynamicTab;
- protected Composite fDynamicTabHolder;
- private boolean fInitDefaults;
-
- protected void setDebugConfig(ICDebugConfiguration config) {
- fCurrentDebugConfig = config;
- }
-
- protected ICDebugConfiguration getDebugConfig() {
- return fCurrentDebugConfig;
- }
-
- protected ILaunchConfigurationTab getDynamicTab() {
- return fDynamicTab;
- }
-
- protected void setDynamicTab(ILaunchConfigurationTab tab) {
- fDynamicTab = tab;
- }
-
- protected Composite getDynamicTabHolder() {
- return fDynamicTabHolder;
- }
-
- protected void setDynamicTabHolder(Composite tabHolder) {
- fDynamicTabHolder = tabHolder;
- }
-
- protected ILaunchConfigurationWorkingCopy getLaunchConfigurationWorkingCopy() {
- return fWorkingCopy;
- }
-
- protected void setLaunchConfiguration(ILaunchConfiguration launchConfiguration) {
- fLaunchConfiguration = launchConfiguration;
- }
-
- protected ILaunchConfiguration getLaunchConfiguration() {
- return fLaunchConfiguration;
- }
-
- protected void setLaunchConfigurationWorkingCopy(ILaunchConfigurationWorkingCopy workingCopy) {
- fWorkingCopy = workingCopy;
- }
-
- /**
- * Overridden here so that any error message in the dynamic UI gets returned.
- *
- * @see ILaunchConfigurationTab#getErrorMessage()
- */
- public String getErrorMessage() {
- ILaunchConfigurationTab tab = getDynamicTab();
- if ((super.getErrorMessage() != null) || (tab == null)) {
- return super.getErrorMessage();
- } else {
- return tab.getErrorMessage();
- }
- }
-
- /**
- * Notification that the user changed the selection of the Debugger.
- */
- protected void handleDebuggerChanged() {
- loadDynamicDebugArea();
-
- // always set the newly created area with defaults
- ILaunchConfigurationWorkingCopy wc = getLaunchConfigurationWorkingCopy();
- if (getDynamicTab() == null) {
- // remove any debug specfic args from the config
- if (wc == null) {
- if (getLaunchConfiguration().isWorkingCopy()) {
- wc = (ILaunchConfigurationWorkingCopy) getLaunchConfiguration();
- }
- }
- if (wc != null) {
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map) null);
- }
- } else {
- if (wc == null) {
- try {
- if (getLaunchConfiguration().isWorkingCopy()) {
- setLaunchConfigurationWorkingCopy((ILaunchConfigurationWorkingCopy)getLaunchConfiguration());
- } else {
- setLaunchConfigurationWorkingCopy(getLaunchConfiguration().getWorkingCopy());
- }
- wc = getLaunchConfigurationWorkingCopy();
-
- } catch (CoreException e) {
- return;
- }
- }
- if (initDefaults()) {
- getDynamicTab().setDefaults(wc);
- }
- setInitializeDefault(false);
- getDynamicTab().initializeFrom(wc);
- }
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Show the contributed piece of UI that was registered for the debugger id
- * of the currently selected debugger.
- */
- protected void loadDynamicDebugArea() {
- // Dispose of any current child widgets in the tab holder area
- Control[] children = getDynamicTabHolder().getChildren();
- for (int i = 0; i < children.length; i++) {
- children[i].dispose();
- }
-
- // Retrieve the dynamic UI for the current Debugger
- ICDebugConfiguration debugConfig = getConfigForCurrentDebugger();
- if (debugConfig == null) {
- setDynamicTab(null);
- } else {
- setDynamicTab(CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID()));
- ICDebugConfiguration oldConfig = getDebugConfig();
- if ( oldConfig != null && oldConfig != debugConfig ) {
- setInitializeDefault(true);
- }
- }
- setDebugConfig(debugConfig);
- if (getDynamicTab() == null) {
- return;
- }
- // Ask the dynamic UI to create its Control
- getDynamicTab().setLaunchConfigurationDialog(getLaunchConfigurationDialog());
- getDynamicTab().createControl(getDynamicTabHolder());
- getDynamicTab().getControl().setVisible(true);
- getDynamicTabHolder().layout(true);
- }
-
- abstract protected ICDebugConfiguration getConfigForCurrentDebugger();
- abstract public void createControl(Composite parent);
-
- public void initializeFrom(ILaunchConfiguration config) {
- setLaunchConfiguration(config);
- ILaunchConfigurationTab dynamicTab = getDynamicTab();
- if (dynamicTab != null) {
- dynamicTab.initializeFrom(config);
- }
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy config) {
- if (getDebugConfig() != null) {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, getDebugConfig().getID());
- ILaunchConfigurationTab dynamicTab = getDynamicTab();
- if (dynamicTab == null) {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map) null);
- } else {
- dynamicTab.performApply(config);
- }
- }
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- setLaunchConfigurationWorkingCopy(config);
- ILaunchConfigurationTab dynamicTab = getDynamicTab();
- if (dynamicTab != null) {
- dynamicTab.setDefaults(config);
- setInitializeDefault(false);
- }
- }
-
- public boolean isValid(ILaunchConfiguration config) {
- setErrorMessage(null);
- setMessage(null);
- if (getDebugConfig() == null) {
- setErrorMessage("No debugger available");
- return false;
- }
-
- ILaunchConfigurationTab dynamicTab = getDynamicTab();
- if (dynamicTab != null) {
- return dynamicTab.isValid(config);
- }
- return true;
- }
-
- protected void setInitializeDefault(boolean init) {
- fInitDefaults = init;
- }
-
- protected boolean initDefaults() {
- return fInitDefaults;
- }
-
- public Image getImage() {
- return LaunchImages.get(LaunchImages.IMG_VIEW_DEBUGGER_TAB);
- }
-
- public String getName() {
- return "Debugger";
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java
deleted file mode 100644
index 2013c1225fb..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.cdt.launch.internal.ui;
-
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.launch.ui.CMainTab;
-import org.eclipse.cdt.launch.ui.CSourceLookupTab;
-import org.eclipse.cdt.launch.ui.CorefileDebuggerTab;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-
-/**
- * Insert the type's description here.
- * @see AbstractLaunchConfigurationTabGroup
- */
-public class CoreFileCLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
-
- /**
- * Insert the method's description here.
- * @see AbstractLaunchConfigurationTabGroup#createTabs
- */
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
- new CMainTab(),
- new CorefileDebuggerTab(),
- new CSourceLookupTab(),
- new CommonTab()
- };
- setTabs(tabs);
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- // This configuration should work for all platforms
- configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, "*");
- super.setDefaults(configuration);
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
deleted file mode 100644
index 928cd34c8be..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.eclipse.cdt.launch.internal.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.cdt.ui.CUIPlugin;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-
-/*
- * (c) Copyright QN Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-public class LaunchImages {
- private static final String NAME_PREFIX= LaunchUIPlugin.PLUGIN_ID + '.';
- private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length();
-
- // The plugin registry
- private static ImageRegistry imageRegistry = new ImageRegistry();
-
- // Subdirectory (under the package containing this class) where 16 color images are
- private static URL fgIconBaseURL;
- static {
- try {
- fgIconBaseURL= new URL(LaunchUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" );
- } catch (MalformedURLException e) {
- //LaunchUIPlugin.getDefault().log(e);
- }
- }
-
- private static final String T_TABS = "tabs/";
-
- public static String IMG_VIEW_MAIN_TAB = NAME_PREFIX + "main_tab.gif";
- public static String IMG_VIEW_ARGUMENTS_TAB = NAME_PREFIX + "arguments_tab.gif";
- public static String IMG_VIEW_ENVIRONMENT_TAB = NAME_PREFIX + "environment_tab.gif";
- public static String IMG_VIEW_DEBUGGER_TAB = NAME_PREFIX + "debugger_tab.gif";
- public static String IMG_VIEW_SOURCE_TAB = NAME_PREFIX + "source_tab.gif";
-
- public static final ImageDescriptor DESC_TAB_MAIN= createManaged(T_TABS, IMG_VIEW_MAIN_TAB);
- public static final ImageDescriptor DESC_TAB_ARGUMENTS = createManaged(T_TABS, IMG_VIEW_ARGUMENTS_TAB);
- public static final ImageDescriptor DESC_TAB_ENVIRONMENT = createManaged(T_TABS, IMG_VIEW_ENVIRONMENT_TAB);
- public static final ImageDescriptor DESC_TAB_DEBUGGER = createManaged(T_TABS, IMG_VIEW_DEBUGGER_TAB);
- public static final ImageDescriptor DESC_TAB_SOURCE = createManaged(T_TABS, IMG_VIEW_SOURCE_TAB);
-
- public static void initialize() {
- }
-
- private static ImageDescriptor createManaged(String prefix, String name) {
- return createManaged(imageRegistry, prefix, name);
- }
-
- private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) {
- ImageDescriptor result= ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH)));
- registry.put(name, result);
- return result;
- }
-
- public static Image get(String key) {
- return imageRegistry.get(key);
- }
-
-
- private static URL makeIconFileURL(String prefix, String name) {
- StringBuffer buffer= new StringBuffer(prefix);
- buffer.append(name);
- try {
- return new URL(fgIconBaseURL, buffer.toString());
- } catch (MalformedURLException e) {
- CUIPlugin.getDefault().log(e);
- return null;
- }
- }
-
- /**
- * Helper method to access the image registry from the JavaPlugin class.
- */
- static ImageRegistry getImageRegistry() {
- return imageRegistry;
- }
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
deleted file mode 100644
index 7a433f3bca3..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package org.eclipse.cdt.launch.internal.ui;
-
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-public class LaunchUIPlugin extends AbstractUIPlugin
- implements IDebugEventSetListener {
- public static final String PLUGIN_ID = "org.eclipse.cdt.launch";
-
- /**
- * Launch UI plug-in instance
- */
- private static LaunchUIPlugin fgPlugin;
- private static Shell debugDialogShell;
-
- /**
- * Constructor for LaunchUIPlugin.
- * @param descriptor
- */
- public LaunchUIPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- setDefault(this);
- }
-/**
- * Sets the Java Debug UI plug-in instance
- *
- * @param plugin the plugin instance
- */
- private static void setDefault(LaunchUIPlugin plugin) {
- fgPlugin = plugin;
- }
-
- /**
- * Returns the Java Debug UI plug-in instance
- *
- * @return the Java Debug UI plug-in instance
- */
- public static LaunchUIPlugin getDefault() {
- return fgPlugin;
- }
-
- public static Shell getShell() {
- if (getActiveWorkbenchShell() != null) {
- return getActiveWorkbenchShell();
- } else {
- if ( debugDialogShell != null ) {
- if (!debugDialogShell.isDisposed() )
- return debugDialogShell;
- debugDialogShell = null;
- }
- IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
- return windows[0].getShell();
- }
- }
-
- public static void setDialogShell(Shell shell) {
- debugDialogShell = shell;
- }
-
- /**
- * Convenience method which returns the unique identifier of this plugin.
- */
- public static String getUniqueIdentifier() {
- if (getDefault() == null) {
- // If the default instance is not yet initialized,
- // return a static identifier. This identifier must
- // match the plugin id defined in plugin.xml
- return "org.eclipse.cdt.launch"; //$NON-NLS-1$
- }
- return getDefault().getDescriptor().getUniqueIdentifier();
- }
-
- /**
- * Logs the specified status with this plug-in's log.
- *
- * @param status status to log
- */
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
- /**
- * Logs an internal error with the specified message.
- *
- * @param message the error message to log
- */
- public static void logErrorMessage(String message) {
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null));
- }
-
- /**
- * Logs an internal error with the specified throwable
- *
- * @param e the exception to be logged
- */
- public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e)); //$NON-NLS-1$
- }
-
- /**
- * Returns the active workbench window
- *
- * @return the active workbench window
- */
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- return getDefault().getWorkbench().getActiveWorkbenchWindow();
- }
-
- public static IWorkbenchPage getActivePage() {
- IWorkbenchWindow w = getActiveWorkbenchWindow();
- if (w != null) {
- return w.getActivePage();
- }
- return null;
- }
-
- /**
- * Returns the active workbench shell or <code>null</code> if none
- *
- * @return the active workbench shell or <code>null</code> if none
- */
- public static Shell getActiveWorkbenchShell() {
- IWorkbenchWindow window = getActiveWorkbenchWindow();
- if (window != null) {
- return window.getShell();
- }
- return null;
- }
-
- public static void errorDialog( String message, IStatus status ) {
- log(status);
- Shell shell = getActiveWorkbenchShell();
- if (shell != null) {
- ErrorDialog.openError(shell, "Error", message, status);
- }
- }
-
- public static void errorDialog(String message, Throwable t) {
- log(t);
- Shell shell = getActiveWorkbenchShell();
- if (shell != null) {
- IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), 1, t.getMessage(), null); //$NON-NLS-1$
- ErrorDialog.openError(shell, "Error", message, status);
- }
- }
- /**
- * @see org.eclipse.core.runtime.Plugin#shutdown()
- */
- public void shutdown() throws CoreException {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- super.shutdown();
- }
-
- /**
- * @see org.eclipse.core.runtime.Plugin#startup()
- */
- public void startup() throws CoreException {
- super.startup();
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /**
- * Notifies this listener of the given debug events.
- * All of the events in the given event collection occurred
- * at the same location the program be run or debugged.
- *
- * @param events the debug events
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- if (events[i].getKind() == DebugEvent.TERMINATE) {
- Object o = events[i].getSource();
- if (o instanceof IProcess) {
- IProcess proc = (IProcess)o;
- ICProject cproject = null;
- try {
- cproject = AbstractCLaunchDelegate.getCProject(proc.getLaunch().getLaunchConfiguration());
- } catch (CoreException e) {
- }
- if (cproject != null) {
- try {
- cproject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (CoreException e) {
- }
- }
- }
- }
- }
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java
deleted file mode 100644
index 278af2b4c64..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.cdt.launch.internal.ui;
-
-import org.eclipse.cdt.launch.ui.CArgumentsTab;
-import org.eclipse.cdt.launch.ui.CDebuggerTab;
-import org.eclipse.cdt.launch.ui.CEnvironmentTab;
-import org.eclipse.cdt.launch.ui.CMainTab;
-import org.eclipse.cdt.launch.ui.CSourceLookupTab;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-
-/**
- * Insert the type's description here.
- * @see AbstractLaunchConfigurationTabGroup
- */
-public class LocalCLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
-
- /**
- * Insert the method's description here.
- * @see AbstractLaunchConfigurationTabGroup#createTabs
- */
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
- new CMainTab(),
- new CArgumentsTab(),
- new CEnvironmentTab(),
- new CDebuggerTab(),
- new CSourceLookupTab(),
- new CommonTab()
- };
- setTabs(tabs);
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
deleted file mode 100644
index 5867bae887c..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
+++ /dev/null
@@ -1,417 +0,0 @@
-package org.eclipse.cdt.launch.internal.ui;
-import java.io.File;
-
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-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.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.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-/**
- * A control for setting the working directory associated with a launch
- * configuration.
- */
-public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
-
- // Working directory UI widgets
- protected Label fWorkingDirLabel;
-
- // Local directory
- protected Button fLocalDirButton;
- protected Text fWorkingDirText;
- protected Button fWorkingDirBrowseButton;
-
-
- // Workspace directory
- protected Button fWorkspaceDirButton;
- protected Text fWorkspaceDirText;
- protected Button fWorkspaceDirBrowseButton;
-
- // use default button
- protected Button fUseDefaultWorkingDirButton;
-
- protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- /**
- * The last launch config this tab was initialized from
- */
- protected ILaunchConfiguration fLaunchConfiguration;
-
- /**
- * @see ILaunchConfigurationTab#createControl(Composite)
- */
- public void createControl(Composite parent) {
-
- Composite workingDirComp = new Composite(parent, SWT.NONE);
-// WorkbenchHelp.setHelp(workingDirComp, IJavaDebugHelpContextIds.WORKING_DIRECTORY_BLOCK);;
- GridLayout workingDirLayout = new GridLayout();
- workingDirLayout.numColumns = 3;
- workingDirLayout.marginHeight = 0;
- workingDirLayout.marginWidth = 0;
- workingDirComp.setLayout(workingDirLayout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- workingDirComp.setLayoutData(gd);
- setControl(workingDirComp);
-
- fWorkingDirLabel = new Label(workingDirComp, SWT.NONE);
- fWorkingDirLabel.setText("Wor&king directory:");
- gd = new GridData();
- gd.horizontalSpan = 3;
- fWorkingDirLabel.setLayoutData(gd);
-
- fUseDefaultWorkingDirButton = new Button(workingDirComp,SWT.CHECK);
- fUseDefaultWorkingDirButton.setText("Use de&fault working directory");
- gd = new GridData();
- gd.horizontalSpan = 3;
- fUseDefaultWorkingDirButton.setLayoutData(gd);
- fUseDefaultWorkingDirButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleUseDefaultWorkingDirButtonSelected();
- }
- });
-
- fLocalDirButton = createRadioButton(workingDirComp, "&Local directory");
- fLocalDirButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleLocationButtonSelected();
- }
- });
-
- fWorkingDirText = new Text(workingDirComp, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- fWorkingDirText.setLayoutData(gd);
- fWorkingDirText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- });
-
- fWorkingDirBrowseButton = createPushButton(workingDirComp, "&Browse", null);
- fWorkingDirBrowseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleWorkingDirBrowseButtonSelected();
- }
- });
-
- fWorkspaceDirButton = createRadioButton(workingDirComp, "Works&pace");
- fWorkspaceDirButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleLocationButtonSelected();
- }
- });
-
- fWorkspaceDirText = new Text(workingDirComp, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- fWorkspaceDirText.setLayoutData(gd);
- fWorkspaceDirText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- });
-
- fWorkspaceDirBrowseButton = createPushButton(workingDirComp, "B&rowse...", null);
- fWorkspaceDirBrowseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleWorkspaceDirBrowseButtonSelected();
- }
- });
-
- }
-
- /**
- * @see ILaunchConfigurationTab#dispose()
- */
- public void dispose() {
- }
-
- /**
- * Show a dialog that lets the user select a working directory
- */
- protected void handleWorkingDirBrowseButtonSelected() {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage("Select a &working directory for the launch configuration");
- String currentWorkingDir = fWorkingDirText.getText();
- if (!currentWorkingDir.trim().equals(EMPTY_STRING)) {
- File path = new File(currentWorkingDir);
- if (path.exists()) {
- dialog.setFilterPath(currentWorkingDir);
- }
- }
-
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
- fWorkingDirText.setText(selectedDirectory);
- }
- }
-
- /**
- * Show a dialog that lets the user select a working directory from
- * the workspace
- */
- protected void handleWorkspaceDirBrowseButtonSelected() {
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
- ResourcesPlugin.getWorkspace().getRoot(),
- false,
- "Select a &workspace relative working directory");
-
- IContainer currentContainer = getContainer();
- if (currentContainer != null) {
- IPath path = currentContainer.getFullPath();
- dialog.setInitialSelections(new Object[] {path});
- }
-
- dialog.showClosedProjects(false);
- dialog.open();
- Object[] results = dialog.getResult();
- if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
- IPath path = (IPath)results[0];
- String containerName = path.makeRelative().toString();
- fWorkspaceDirText.setText(containerName);
- }
- }
-
- /**
- * Returns the selected workspace container,or <code>null</code>
- */
- protected IContainer getContainer() {
- IResource res = getResource();
- if (res instanceof IContainer) {
- return (IContainer)res;
- }
- return null;
- }
-
- /**
- * Returns the selected workspace resource, or <code>null</code>
- */
- protected IResource getResource() {
- IPath path = new Path(fWorkspaceDirText.getText());
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- return root.findMember(path);
- }
-
- /**
- * The "local directory" or "workspace directory" button has been selected.
- */
- protected void handleLocationButtonSelected() {
- if (!isDefaultWorkingDirectory()) {
- boolean local = isLocalWorkingDirectory();
- fWorkingDirText.setEnabled(local);
- fWorkingDirBrowseButton.setEnabled(local);
- fWorkspaceDirText.setEnabled(!local);
- fWorkspaceDirBrowseButton.setEnabled(!local);
- }
- updateLaunchConfigurationDialog();
- }
-
- /**
- * The default working dir check box has been toggled.
- */
- protected void handleUseDefaultWorkingDirButtonSelected() {
- if (isDefaultWorkingDirectory()) {
- setDefaultWorkingDir();
- fLocalDirButton.setEnabled(false);
- fWorkingDirText.setEnabled(false);
- fWorkingDirBrowseButton.setEnabled(false);
- fWorkspaceDirButton.setEnabled(false);
- fWorkspaceDirText.setEnabled(false);
- fWorkspaceDirBrowseButton.setEnabled(false);
- } else {
- fLocalDirButton.setEnabled(true);
- fWorkspaceDirButton.setEnabled(true);
- handleLocationButtonSelected();
- }
- }
-
- /**
- * Sets the default working directory
- */
- protected void setDefaultWorkingDir() {
- ILaunchConfiguration config = getLaunchConfiguration();
- if (config != null) {
- ICProject cProject = null;
- try {
- cProject = AbstractCLaunchDelegate.getCProject(config);
- } catch (CoreException e) {
- }
- if (cProject != null) {
- fWorkspaceDirText.setText(cProject.getPath().makeRelative().toOSString());
- fLocalDirButton.setSelection(false);
- fWorkspaceDirButton.setSelection(true);
- return;
- }
- }
-
- fWorkingDirText.setText(System.getProperty("user.dir"));
- fLocalDirButton.setSelection(true);
- fWorkspaceDirButton.setSelection(false);
- }
-
- /**
- * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
-
- setErrorMessage(null);
- setMessage(null);
-
- if (isLocalWorkingDirectory()) {
- String workingDirPath = fWorkingDirText.getText().trim();
- if (workingDirPath.length() > 0) {
- File dir = new File(workingDirPath);
- if (!dir.exists()) {
- setErrorMessage("Working directory does not exist");
- return false;
- }
- if (!dir.isDirectory()) {
- setErrorMessage("Working directory is not a directory_11");
- return false;
- }
- }
- } else {
- if (getContainer() == null) {
- setErrorMessage("Specified project or folder does not exist.");
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Defaults are empty.
- *
- * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null);
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
- }
-
- /**
- * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- setLaunchConfiguration(configuration);
- try {
- String wd = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
- fWorkspaceDirText.setText(EMPTY_STRING);
- fWorkingDirText.setText(EMPTY_STRING);
- if (wd == null) {
- fUseDefaultWorkingDirButton.setSelection(true);
- } else {
- IPath path = new Path(wd);
- if (path.isAbsolute()) {
- fWorkingDirText.setText(wd);
- fLocalDirButton.setSelection(true);
- fWorkspaceDirButton.setSelection(false);
- } else {
- fWorkspaceDirText.setText(wd);
- fWorkspaceDirButton.setSelection(true);
- fLocalDirButton.setSelection(false);
- }
- fUseDefaultWorkingDirButton.setSelection(false);
- }
- handleUseDefaultWorkingDirButtonSelected();
- } catch (CoreException e) {
- setErrorMessage("Exception occurred reading configuration " + e.getStatus().getMessage());
- LaunchUIPlugin.log(e);
- }
- }
-
- /**
- * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- String wd = null;
- if (!isDefaultWorkingDirectory()) {
- if (isLocalWorkingDirectory()) {
- wd = getAttributeValueFrom(fWorkingDirText);
- } else {
- IPath path = new Path(fWorkspaceDirText.getText());
- path = path.makeRelative();
- wd = path.toString();
- }
- }
- configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, wd);
- }
-
- /**
- * Retuns the string in the text widget, or <code>null</code> if empty.
- *
- * @return text or <code>null</code>
- */
- protected String getAttributeValueFrom(Text text) {
- String content = text.getText().trim();
- if (content.length() > 0) {
- return content;
- }
- return null;
- }
-
- /**
- * @see ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return "Working Directory";
- }
-
- /**
- * Returns whether the default working directory is to be used
- */
- protected boolean isDefaultWorkingDirectory() {
- return fUseDefaultWorkingDirButton.getSelection();
- }
-
- /**
- * Returns whether the working directory is local
- */
- protected boolean isLocalWorkingDirectory() {
- return fLocalDirButton.getSelection();
- }
-
- /**
- * Sets the java project currently specified by the
- * given launch config, if any.
- */
- protected void setLaunchConfiguration(ILaunchConfiguration config) {
- fLaunchConfiguration = config;
- }
-
- /**
- * Returns the current java project context
- */
- protected ILaunchConfiguration getLaunchConfiguration() {
- return fLaunchConfiguration;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
- */
- protected void updateLaunchConfigurationDialog() {
- super.updateLaunchConfigurationDialog();
- }
-
-}
-
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java
deleted file mode 100644
index 0a2e38dc9cd..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- *(c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- *
- */
-package org.eclipse.cdt.launch.sourcelookup;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.text.MessageFormat;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.xerces.dom.DocumentImpl;
-import org.eclipse.cdt.debug.core.CDebugUtils;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
-import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode;
-import org.eclipse.cdt.debug.ui.sourcelookup.CUISourceLocator;
-import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.IPersistableSourceLocator;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * The wrapper for the CUISourceLocator class.
- *
- * @since: Dec 11, 2002
- */
-public class DefaultSourceLocator implements IPersistableSourceLocator, IAdaptable
-{
- private static final String ELEMENT_NAME = "PromptingSourceLocator";
- private static final String ATTR_PROJECT = "project";
- private static final String ATTR_MEMENTO = "memento";
-
- /**
- * Identifier for the 'Default C/C++ Source Locator' extension
- * (value <code>"org.eclipse.cdt.launch.DefaultSourceLocator"</code>).
- */
- public static final String ID_DEFAULT_SOURCE_LOCATOR = LaunchUIPlugin.getUniqueIdentifier() + ".DefaultSourceLocator"; //$NON-NLS-1$
-
- private CUISourceLocator fSourceLocator = null;
- private final static int ERROR = 1000; // ????
-
- /**
- * Constructor for DefaultSourceLocator.
- */
- public DefaultSourceLocator()
- {
- }
-
- /**
- * Constructor for DefaultSourceLocator.
- */
- public DefaultSourceLocator( CUISourceLocator locator )
- {
- fSourceLocator = locator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento()
- */
- public String getMemento() throws CoreException
- {
- if ( fSourceLocator != null )
- {
- Document doc = new DocumentImpl();
- Element node = doc.createElement( ELEMENT_NAME );
- doc.appendChild( node );
- node.setAttribute( ATTR_PROJECT, fSourceLocator.getProject().getName() );
-
- IPersistableSourceLocator psl = getPersistableSourceLocator();
- if ( psl != null )
- {
- node.setAttribute( ATTR_MEMENTO, psl.getMemento() );
- }
- try
- {
- return CDebugUtils.serializeDocument( doc, " " );
- }
- catch( IOException e )
- {
- abort( "Unable to create memento for C/C++ source locator.", e );
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeFromMemento(String)
- */
- public void initializeFromMemento( String memento ) throws CoreException
- {
- Exception ex = null;
- try
- {
- Element root = null;
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- StringReader reader = new StringReader( memento );
- InputSource source = new InputSource( reader );
- root = parser.parse( source ).getDocumentElement();
-
- if ( !root.getNodeName().equalsIgnoreCase( ELEMENT_NAME ) )
- {
- abort( "Unable to restore prompting source locator - invalid format.", null );
- }
-
- String projectName = root.getAttribute( ATTR_PROJECT );
- String data = root.getAttribute( ATTR_MEMENTO );
- if ( isEmpty( projectName ) )
- {
- abort( "Unable to restore prompting source locator - invalid format.", null );
- }
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName );
- if ( project == null )
- {
- abort( MessageFormat.format( "Unable to restore prompting source locator - project {0} not found.", new String[] { projectName } ), null );
- }
- ICSourceLocator locator = getCSourceLocator();
- if ( locator == null )
- {
- fSourceLocator = new CUISourceLocator( project );
- }
- else if ( locator.getProject() != null && !project.equals( locator.getProject() ) )
- {
- return;
- }
- IPersistableSourceLocator psl = getPersistableSourceLocator();
- if ( psl != null )
- {
- psl.initializeFromMemento( data );
- }
- else
- {
- abort( "Unable to restore C/C++ source locator - invalid format.", null );
- }
- return;
- }
- catch( ParserConfigurationException e )
- {
- ex = e;
- }
- catch( SAXException e )
- {
- ex = e;
- }
- catch( IOException e )
- {
- ex = e;
- }
- abort( "Exception occurred initializing source locator.", ex );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(ILaunchConfiguration)
- */
- public void initializeDefaults( ILaunchConfiguration configuration ) throws CoreException
- {
- fSourceLocator = new CUISourceLocator( getProject( configuration ) );
- String memento = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, "" );
- if ( !isEmpty( memento ) )
- initializeFromMemento( memento );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ISourceLocator#getSourceElement(IStackFrame)
- */
- public Object getSourceElement( IStackFrame stackFrame )
- {
- return ( fSourceLocator != null ) ? fSourceLocator.getSourceElement( stackFrame ) : null;
- }
-
- private IProject getProject( ILaunchConfiguration configuration ) throws CoreException
- {
- String projectName = configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null );
- if ( !isEmpty( projectName ) )
- {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName );
- if ( project.exists() )
- {
- return project;
- }
- }
- abort( MessageFormat.format( "Project \"{0}\" does not exist.", new String[] { projectName } ), null );
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class)
- */
- public Object getAdapter( Class adapter )
- {
- if ( fSourceLocator != null )
- {
- if ( adapter.equals( ICSourceLocator.class ) )
- {
- return fSourceLocator.getAdapter( adapter );
- }
- if ( adapter.equals( IResourceChangeListener.class ) )
- {
- return fSourceLocator.getAdapter( adapter );
- }
- if ( adapter.equals( ISourceMode.class ) )
- {
- return fSourceLocator.getAdapter( adapter );
- }
- }
- return null;
- }
-
- private ICSourceLocator getCSourceLocator()
- {
- if ( fSourceLocator != null )
- {
- return (ICSourceLocator)fSourceLocator.getAdapter( ICSourceLocator.class );
- }
- return null;
- }
-
- private IPersistableSourceLocator getPersistableSourceLocator()
- {
- ICSourceLocator sl = getCSourceLocator();
- return ( sl instanceof IPersistableSourceLocator ) ? (IPersistableSourceLocator)sl : null;
- }
-
- /**
- * Throws an internal error exception
- */
- private void abort( String message, Throwable e ) throws CoreException
- {
- IStatus s = new Status( IStatus.ERROR,
- LaunchUIPlugin.getUniqueIdentifier(),
- ERROR,
- message,
- e );
- throw new CoreException( s );
- }
-
-
- private boolean isEmpty( String string )
- {
- return string == null || string.length() == 0;
- }
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
deleted file mode 100644
index e51727cf290..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
+++ /dev/null
@@ -1,182 +0,0 @@
-package org.eclipse.cdt.launch.ui;
-
-/*
- * (c) Copyright QNX Software System 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.launch.internal.ui.LaunchImages;
-import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
-import org.eclipse.cdt.launch.internal.ui.WorkingDirectoryBlock;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * A launch configuration tab that displays and edits program arguments,
- * and working directory launch configuration attributes.
- * <p>
- * This class may be instantiated. This class is not intended to be subclassed.
- * </p>
- */
-public class CArgumentsTab extends CLaunchConfigurationTab {
-
- // Program arguments UI widgets
- protected Label fPrgmArgumentsLabel;
- protected Text fPrgmArgumentsText;
-
- // Working directory
- protected WorkingDirectoryBlock fWorkingDirectoryBlock = new WorkingDirectoryBlock();
-
- /**
- * @see ILaunchConfigurationTab#createControl(Composite)
- */
- public void createControl(Composite parent) {
-
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
- GridLayout topLayout = new GridLayout();
- comp.setLayout(topLayout);
- GridData gd;
-
- createVerticalSpacer(comp, 1);
-
- fPrgmArgumentsLabel = new Label(comp, SWT.NONE);
- fPrgmArgumentsLabel.setText("C/C++ Program Arguments:");
- fPrgmArgumentsText = new Text(comp, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint = 40;
- fPrgmArgumentsText.setLayoutData(gd);
- fPrgmArgumentsText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- });
-
- createVerticalSpacer(comp, 1);
-
- fWorkingDirectoryBlock.createControl(comp);
- }
-
- /**
- * @see ILaunchConfigurationTab#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
- return fWorkingDirectoryBlock.isValid(config);
- }
-
- /**
- * Defaults are empty.
- *
- * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null);
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
- }
-
- /**
- * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- try {
- fPrgmArgumentsText.setText(configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "")); //$NON-NLS-1$
- fWorkingDirectoryBlock.initializeFrom(configuration);
- }
- catch (CoreException e) {
- setErrorMessage("Exception occurred reading configuration " + e.getStatus().getMessage());
- LaunchUIPlugin.log(e);
- }
- }
-
- /**
- * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
- getAttributeValueFrom(fPrgmArgumentsText));
- fWorkingDirectoryBlock.performApply(configuration);
- }
-
- /**
- * Retuns the string in the text widget, or <code>null</code> if empty.
- *
- * @return text or <code>null</code>
- */
- protected String getAttributeValueFrom(Text text) {
- String content = text.getText().trim();
- if (content.length() > 0) {
- return content;
- }
- return null;
- }
-
- /**
- * @see ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return "Arguments";
- }
-
- /**
- * @see ILaunchConfigurationTab#setLaunchConfigurationDialog(ILaunchConfigurationDialog)
- */
- public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) {
- super.setLaunchConfigurationDialog(dialog);
- fWorkingDirectoryBlock.setLaunchConfigurationDialog(dialog);
- }
- /**
- * @see ILaunchConfigurationTab#getErrorMessage()
- */
- public String getErrorMessage() {
- String m = super.getErrorMessage();
- if (m == null) {
- return fWorkingDirectoryBlock.getErrorMessage();
- }
- return m;
- }
-
- /**
- * @see ILaunchConfigurationTab#getMessage()
- */
- public String getMessage() {
- String m = super.getMessage();
- if (m == null) {
- return fWorkingDirectoryBlock.getMessage();
- }
- return m;
- }
-
- /**
- * @see ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return LaunchImages.get(LaunchImages.IMG_VIEW_ARGUMENTS_TAB);
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
- */
- protected void updateLaunchConfigurationDialog() {
- super.updateLaunchConfigurationDialog();
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
deleted file mode 100644
index 00ecf7c131a..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * (c) Copyright QNX Software System Ltd. 2002.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.launch.ui;
-
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.debug.core.CDebugCorePlugin;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab;
-import org.eclipse.core.boot.BootLoader;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-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.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-
-public class CDebuggerTab extends AbstractCDebuggerTab {
-
- protected Combo fDCombo;
- protected Button fStopInMain;
- protected Button fAttachButton;
- protected Button fRunButton;
- protected Button fVarBookKeeping;
-
- private final boolean DEFAULT_STOP_AT_MAIN = true;
-
- public void createControl(Composite parent) {
- GridData gd;
-
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
- GridLayout layout = new GridLayout(2, false);
- comp.setLayout(layout);
-
- Composite comboComp = new Composite(comp, SWT.NONE);
- layout = new GridLayout(2, false);
- comboComp.setLayout(layout);
- Label dlabel = new Label(comboComp, SWT.NONE);
- dlabel.setText("Debugger:");
- fDCombo = new Combo(comboComp, SWT.DROP_DOWN | SWT.READ_ONLY);
- fDCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateComboFromSelection();
- }
- });
-
- Composite radioComp = new Composite(comp, SWT.NONE);
- GridLayout radioLayout = new GridLayout(2, true);
- radioLayout.marginHeight = 0;
- radioLayout.marginWidth = 0;
- radioComp.setLayout(radioLayout);
- fRunButton = createRadioButton(radioComp, "Run program in debugger.");
- fRunButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (fRunButton.getSelection() == true) {
- fStopInMain.setEnabled(true);
- } else {
- fStopInMain.setEnabled(false);
- }
- updateLaunchConfigurationDialog();
- }
- });
- fAttachButton = createRadioButton(radioComp, "Attach to running process.");
- fAttachButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
-
-
- Composite optionComp = new Composite(comp, SWT.NONE);
- layout = new GridLayout(2, false);
- optionComp.setLayout(layout);
- gd = new GridData();
- gd.horizontalSpan = 2;
- optionComp.setLayoutData(gd);
-
- fStopInMain = new Button(optionComp, SWT.CHECK);
- fStopInMain.setText("Stop at main() on startup.");
- fStopInMain.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
-
- fVarBookKeeping = new Button(optionComp, SWT.CHECK);
- fVarBookKeeping.setText("Enable variable bookkeeping.");
- fVarBookKeeping.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
-
- Group debuggerGroup = new Group(comp, SWT.SHADOW_ETCHED_IN);
- debuggerGroup.setText("Debugger Options");
- setDynamicTabHolder(debuggerGroup);
- GridLayout tabHolderLayout = new GridLayout();
- tabHolderLayout.marginHeight = 0;
- tabHolderLayout.marginWidth = 0;
- tabHolderLayout.numColumns = 1;
- getDynamicTabHolder().setLayout(tabHolderLayout);
- gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- getDynamicTabHolder().setLayoutData(gd);
- }
-
- protected void loadDebuggerComboBox(ILaunchConfiguration config, String selection) {
- ICDebugConfiguration[] debugConfigs;
- String configPlatform = getPlatform(config);
- String programCPU = "native";
- ICElement ce = getContext(config, configPlatform);
- if (ce instanceof IBinary) {
- IBinary bin = (IBinary) ce;
- programCPU = bin.getCPU();
- }
- fDCombo.removeAll();
- debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations();
- Arrays.sort(debugConfigs, new Comparator() {
- public int compare(Object o1, Object o2) {
- ICDebugConfiguration ic1 = (ICDebugConfiguration) o1;
- ICDebugConfiguration ic2 = (ICDebugConfiguration) o2;
- return ic1.getName().compareTo(ic2.getName());
- }
- });
- int x = 0;
- int selndx = -1;
- for (int i = 0; i < debugConfigs.length; i++) {
- if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)
- || debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) {
- String debuggerPlatform = debugConfigs[i].getPlatform();
- boolean isNative = configPlatform.equals(BootLoader.getOS());
- if (debuggerPlatform.equalsIgnoreCase(configPlatform)
- || (isNative && debuggerPlatform.equalsIgnoreCase("native"))) {
- if (debugConfigs[i].supportsCPU(programCPU)) {
- fDCombo.add(debugConfigs[i].getName());
- fDCombo.setData(Integer.toString(x), debugConfigs[i]);
- // select first exact matching debugger for platform or requested selection
- if ((selndx == -1 && debuggerPlatform.equalsIgnoreCase(configPlatform))
- || selection.equals(debugConfigs[i].getID())) {
- selndx = x;
- }
- x++;
- }
- }
- }
- }
- // if no selection meaning nothing in config the force initdefault on tab
- setInitializeDefault(selection.equals("") ? true : false);
-
- fDCombo.select(selndx == -1 ? 0 : selndx);
- //The behaviour is undefined for if the callbacks should be triggered for this,
- //so to avoid unnecessary confusion, we force an update.
- updateComboFromSelection();
- fDCombo.getParent().layout(true);
- }
-
- protected void updateComboFromSelection() {
- handleDebuggerChanged();
- ICDebugConfiguration debugConfig = getConfigForCurrentDebugger();
- if (debugConfig != null) {
- fRunButton.setEnabled(debugConfig.supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN));
- fRunButton.setSelection(false);
- fAttachButton.setEnabled(debugConfig.supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH));
- fAttachButton.setSelection(false);
- try {
- String mode =
- getLaunchConfiguration().getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- if (mode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN) && fRunButton.isEnabled()) {
- fRunButton.setSelection(true);
- } else if (mode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH) && fAttachButton.isEnabled()) {
- fAttachButton.setSelection(true);
- }
- if (fRunButton.getSelection() == true) {
- fStopInMain.setEnabled(true);
- } else {
- fStopInMain.setEnabled(false);
- }
- } catch (CoreException ex) {
- }
- }
- updateLaunchConfigurationDialog();
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- super.setDefaults(config);
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, DEFAULT_STOP_AT_MAIN);
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false);
- config.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- }
-
- public void initializeFrom(ILaunchConfiguration config) {
- super.initializeFrom(config);
- try {
- String id = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "");
- if (getDebugConfig() == null || !getDebugConfig().getID().equals(id)) {
- loadDebuggerComboBox(config, id);
- }
- String mode =
- config.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- if (mode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) {
- fRunButton.setSelection(true);
- fAttachButton.setSelection(false);
- } else if (mode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) {
- fAttachButton.setSelection(true);
- fRunButton.setSelection(false);
- }
- if (config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, DEFAULT_STOP_AT_MAIN) == true) {
- fStopInMain.setSelection(true);
- }
- if (config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false) == true) {
- fVarBookKeeping.setSelection(true);
- }
- } catch (CoreException e) {
- return;
- }
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy config) {
- if (isValid(config)) {
- super.performApply(config);
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false);
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, fVarBookKeeping.getSelection());
- if (fAttachButton.getSelection() == true) {
- config.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH);
- } else {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, fStopInMain.getSelection());
- config.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- }
- }
- }
-
- public boolean isValid(ILaunchConfiguration config) {
- if (!validateDebuggerConfig(config)) {
- setErrorMessage("No debugger available");
- return false;
- }
- if (super.isValid(config) == false) {
- return false;
- }
- if (!fRunButton.getSelection() && !fAttachButton.getSelection()) {
- setErrorMessage("Select a Debug mode.");
- return false;
- }
- return true;
- }
-
- private boolean validateDebuggerConfig(ILaunchConfiguration config) {
- String platform = getPlatform(config);
- ICElement ce = getContext(config, null);
- String projectPlatform = getPlatform(config);
- String projectCPU = "native";
- if (ce != null) {
- if (ce instanceof IBinary) {
- IBinary bin = (IBinary) ce;
- projectCPU = bin.getCPU();
- }
- }
- ICDebugConfiguration debugConfig = getDebugConfig();
- if (debugConfig == null) {
- return false;
- }
- String debuggerPlatform = debugConfig.getPlatform();
- boolean isNative = platform.equals(projectPlatform);
- if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (isNative && debuggerPlatform.equalsIgnoreCase("native"))) {
- if (debugConfig.supportsCPU(projectCPU)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return the class that implements <code>ILaunchConfigurationTab</code>
- * that is registered against the debugger id of the currently selected debugger.
- */
- protected ICDebugConfiguration getConfigForCurrentDebugger() {
- int selectedIndex = fDCombo.getSelectionIndex();
- return (ICDebugConfiguration) fDCombo.getData(Integer.toString(selectedIndex));
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
- */
- protected void updateLaunchConfigurationDialog() {
- super.updateLaunchConfigurationDialog();
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java
deleted file mode 100644
index eef1a09d157..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package org.eclipse.cdt.launch.ui;
-
-/*
- * (c) Copyright QNX Software System 2002.
- * All Rights Reserved.
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Properties;
-
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.launch.internal.ui.LaunchImages;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-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.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-
-public class CEnvironmentTab extends CLaunchConfigurationTab {
-
- protected Properties fElements;
-
- protected TableViewer fVariableList;
- protected Button fBtnNew;
- protected Button fBtnEdit;
- protected Button fBtnRemove;
-
- class SimpleSorter extends ViewerSorter {
- public boolean isSorterProperty(Object element, Object property) {
- return true;
- }
- }
-
- class ElementsContentProvider implements IStructuredContentProvider {
- Object input = null;
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object parent) {
- return fElements.entrySet().toArray();
- }
- }
-
- class ElementsLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if (element != null && element instanceof Map.Entry) {
- return (columnIndex == 0) ? ((Map.Entry) element).getKey().toString() : ((Map.Entry) element).getValue().toString();
- }
- return null;
- }
- }
-
- class EntryDialog extends Dialog {
- private String fName;
- private String fValue;
- private boolean fEdit = false;
-
- private Button fBtnOk = null;
- private Button fBtnCancel = null;
- private Text fTextName = null;
- private Text fTextValue = null;
-
- public EntryDialog(String name, String value, boolean edit) {
- super(CEnvironmentTab.this.getControl().getShell());
- fName = name;
- fValue = value;
- fEdit = edit;
- }
-
- protected Control createContents(Composite parent) {
- Control result = super.createContents(parent);
- updateButtonsState();
- return result;
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- String title = (fEdit) ? "Edit Variable" : "New Variable";
- shell.setText(title);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 5;
- layout.numColumns = 2;
- composite.setLayout(layout);
-
- GC gc = new GC(composite);
- gc.setFont(composite.getFont());
- FontMetrics metrics = gc.getFontMetrics();
- gc.dispose();
- int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50);
-
- Label label = new Label(composite, SWT.NONE);
- label.setText("Name:");
- fTextName = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.grabExcessHorizontalSpace = true;
- gd.widthHint = fieldWidthHint;
- fTextName.setLayoutData(gd);
- label = new Label(composite, SWT.NONE);
- label.setText("Value:");
- fTextValue = new Text(composite, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_BOTH);
- gd.grabExcessHorizontalSpace = true;
- gd.widthHint = fieldWidthHint;
- fTextValue.setLayoutData(gd);
- fTextName.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateButtonsState();
- }
- });
- fTextValue.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateButtonsState();
- }
- });
- fTextName.setText(fName);
- fTextValue.setText(fValue);
-
- return composite;
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- fBtnOk = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- fBtnCancel = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected void updateButtonsState() {
- if (fBtnOk != null)
- fBtnOk.setEnabled(fTextName.getText().trim().length() > 0);
- }
-
- protected String getName() {
- return fName;
- }
-
- protected String getValue() {
- return fValue;
- }
-
- protected void okPressed() {
- fName = fTextName.getText().trim();
- fValue = fTextValue.getText().trim();
- setReturnCode(OK);
- close();
- }
- }
-
- public void createControl(Composite parent) {
- fElements = new Properties();
- Composite control = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout(2, false);
-
- createVerticalSpacer(control, 2);
-
- control.setLayout(gl);
- createVariableList(control);
- createButtons(control);
- setControl(control);
- fVariableList.setInput(fElements);
- fVariableList.getTable().setFocus();
- }
-
- public void set(String env) {
- fElements.clear();
- ByteArrayInputStream input = new ByteArrayInputStream(env.getBytes());
- try {
- fElements.load(input);
- } catch (IOException e) {
- }
-
- fVariableList.refresh();
- fVariableList.getTable().setFocus();
- if (fVariableList.getTable().getItemCount() > 0)
- fVariableList.getTable().setSelection(0);
- }
-
- public String get() {
- String result = new String();
- Object[] entries = fElements.entrySet().toArray();
- for (int i = 0; i < entries.length; ++i)
- result += entries[i].toString() + '\n';
- return result;
- }
-
- public Properties getProperties() {
- return fElements;
- }
-
- public Object[] toArray() {
- return fElements.entrySet().toArray();
- }
-
- private void createVariableList(Composite parent) {
- fVariableList = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- fVariableList.setContentProvider(new ElementsContentProvider());
- fVariableList.setLabelProvider(new ElementsLabelProvider());
- fVariableList.setSorter(new SimpleSorter());
-
- Table table = fVariableList.getTable();
-
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
-
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- gd.grabExcessVerticalSpace = true;
- gd.grabExcessHorizontalSpace = true;
- table.setLayoutData(gd);
-
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableColumn column1 = new TableColumn(table, SWT.NULL);
- column1.setText("Name");
- tableLayout.addColumnData(new ColumnWeightData(30));
-
- TableColumn column2 = new TableColumn(table, SWT.NULL);
- column2.setText("Value");
- tableLayout.addColumnData(new ColumnWeightData(30));
-
- fVariableList.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent e) {
- elementDoubleClicked((IStructuredSelection) e.getSelection());
- }
- });
- fVariableList.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- updateButtons();
- }
- });
- }
-
- private void createButtons(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
- composite.setLayout(new GridLayout(1, true));
- fBtnNew = new Button(composite, SWT.NONE);
- fBtnNew.setText("New...");
- fBtnNew.setLayoutData(new GridData(GridData.FILL_BOTH));
- fBtnNew.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- newEntry();
- }
- });
- fBtnEdit = new Button(composite, SWT.NONE);
- fBtnEdit.setText("Edit...");
- fBtnEdit.setLayoutData(new GridData(GridData.FILL_BOTH));
- fBtnEdit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- edit();
- }
- });
- fBtnRemove = new Button(composite, SWT.NONE);
- fBtnRemove.setText("Remove");
- fBtnRemove.setLayoutData(new GridData(GridData.FILL_BOTH));
- fBtnRemove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- remove();
- }
- });
- }
-
- protected void updateButtons() {
- IStructuredSelection selection = (IStructuredSelection) fVariableList.getSelection();
- fBtnEdit.setEnabled(selection.size() == 1);
- fBtnRemove.setEnabled(selection.size() > 0);
- }
-
- protected void elementDoubleClicked(IStructuredSelection selection) {
- if (selection.size() != 1)
- return;
- doEdit((Map.Entry) selection.getFirstElement());
- }
-
- protected void newEntry() {
- EntryDialog dialog = new EntryDialog(new String(), new String(), false);
- if (dialog.open() == EntryDialog.OK) {
- fElements.setProperty(dialog.getName(), dialog.getValue());
- fVariableList.refresh();
- }
- updateButtons();
- updateLaunchConfigurationDialog();
- }
-
- protected void edit() {
- IStructuredSelection selection = (IStructuredSelection) fVariableList.getSelection();
- doEdit((Map.Entry) selection.getFirstElement());
- }
-
- protected void doEdit(Map.Entry entry) {
- EntryDialog dialog = new EntryDialog(entry.getKey().toString(), entry.getValue().toString(), true);
- if (dialog.open() == EntryDialog.OK) {
- fElements.remove(entry.getKey());
- fElements.setProperty(dialog.getName(), dialog.getValue());
- fVariableList.refresh();
- }
- updateButtons();
- updateLaunchConfigurationDialog();
- }
-
- protected void remove() {
- IStructuredSelection selection = (IStructuredSelection) fVariableList.getSelection();
- Object[] elements = selection.toArray();
- for (int i = 0; i < elements.length; ++i)
- fElements.remove(((Map.Entry) elements[i]).getKey());
- fVariableList.refresh();
- updateButtons();
- updateLaunchConfigurationDialog();
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true);
- }
-
- public void initializeFrom(ILaunchConfiguration config) {
- try {
- Map env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
- if (env != null) {
- fElements.clear();
- fElements.putAll(env);
- fVariableList.refresh();
- updateButtons();
- }
- // config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true);
- } catch (CoreException e) {
- }
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) fElements.clone());
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true);
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return "Environment";
- }
-
- /**
- * @see ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return LaunchImages.get(LaunchImages.IMG_VIEW_ENVIRONMENT_TAB);
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java
deleted file mode 100644
index c7832d439bd..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package org.eclipse.cdt.launch.ui;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.ICDescriptor;
-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.LaunchUIPlugin;
-import org.eclipse.core.boot.BootLoader;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-public abstract class CLaunchConfigurationTab extends AbstractLaunchConfigurationTab {
-
- /**
- * Returns the current C element context from which to initialize
- * default settings, or <code>null</code> if none.
- * Note, if possible we will return the IBinary based on config entry
- * as this may be more usefull then just the project.
- * @return C element context.
- */
- protected ICElement getContext(ILaunchConfiguration config, String platform) {
- String projectName = null;
- String programName = null;
- IWorkbenchPage page = LaunchUIPlugin.getActivePage();
- Object obj = null;
- try {
- projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
- programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) null);
- }
- catch (CoreException e) {
- }
- if (projectName != null && !projectName.equals("")) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project);
- if (cProject != null && cProject.exists()) {
- obj = cProject;
- }
- }
- else {
- if (page != null) {
- ISelection selection = page.getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- if (!ss.isEmpty()) {
- obj = ss.getFirstElement();
- }
- }
- }
- }
- if (obj instanceof IResource) {
- ICElement ce = CoreModel.getDefault().create((IResource) obj);
- if (ce == null) {
- IProject pro = ((IResource) obj).getProject();
- ce = CoreModel.getDefault().create(pro);
- }
- obj = ce;
- }
- if (obj instanceof ICElement) {
- if (platform != null && !platform.equals("*")) {
- ICDescriptor descriptor;
- try {
- descriptor = CCorePlugin.getDefault().getCProjectDescription(((ICElement) obj).getCProject().getProject());
- String projectPlatform = descriptor.getPlatform();
- if (!projectPlatform.equals(platform) && !projectPlatform.equals("*")) {
- obj = null;
- }
- }
- catch (CoreException e) {
- }
- }
- if (obj != null) {
- if (programName == null || programName.equals("")) {
- return (ICElement) obj;
- }
- ICElement ce = (ICElement) obj;
- IProject project;
- project = (IProject) ce.getCProject().getResource();
- IPath programFile = project.getFile(programName).getLocation();
- ce = CCorePlugin.getDefault().getCoreModel().create(programFile);
- if (ce != null && ce.exists()) {
- return ce;
- }
- return (ICElement) obj;
- }
- }
- IEditorPart part = page.getActiveEditor();
- if (part != null) {
- IEditorInput input = part.getEditorInput();
- return (ICElement) input.getAdapter(ICElement.class);
- }
- return null;
- }
-
- /**
- * Set the C project attribute based on the ICElement.
- */
- protected void initializeCProject(ICElement cElement, ILaunchConfigurationWorkingCopy config) {
- ICProject cProject = cElement.getCProject();
- String name = null;
- if (cProject != null && cProject.exists()) {
- name = cProject.getElementName();
- }
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, name);
-
- }
-
- protected String getPlatform(ILaunchConfiguration config) {
- String platform = BootLoader.getOS();
- try {
- return config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, platform);
- }
- catch (CoreException e) {
- return platform;
- }
- }
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
deleted file mode 100644
index 41da4b76b42..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
+++ /dev/null
@@ -1,412 +0,0 @@
-package org.eclipse.cdt.launch.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.ICDescriptor;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.IBinary;
-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.LaunchUIPlugin;
-import org.eclipse.cdt.ui.CElementLabelProvider;
-import org.eclipse.core.boot.BootLoader;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * A launch configuration tab that displays and edits project and
- * main type name launch configuration attributes.
- * <p>
- * This class may be instantiated. This class is not intended to be subclassed.
- * </p>
- * @since 2.0
- */
-
-public class CMainTab extends CLaunchConfigurationTab {
-
- // Project UI widgets
- protected Label fProjLabel;
- protected Text fProjText;
- protected Button fProjButton;
-
- // Main class UI widgets
- protected Label fProgLabel;
- protected Text fProgText;
- protected Button fSearchButton;
-
- protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- private String filterPlatform = EMPTY_STRING;
-
- /**
- * @see ILaunchConfigurationTab#createControl(Composite)
- */
- public void createControl(Composite parent) {
-
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
- GridLayout topLayout = new GridLayout();
- comp.setLayout(topLayout);
-
- createVerticalSpacer(comp, 1);
-
- Composite projComp = new Composite(comp, 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);
- projComp.setLayoutData(gd);
-
- fProjLabel = new Label(projComp, SWT.NONE);
- fProjLabel.setText("&Project:");
- 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, "&Browse...", null);
- fProjButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleProjectButtonSelected();
- updateLaunchConfigurationDialog();
- }
- });
-
- createVerticalSpacer(comp, 1);
-
- Composite mainComp = new Composite(comp, SWT.NONE);
- GridLayout mainLayout = new GridLayout();
- mainLayout.numColumns = 2;
- mainLayout.marginHeight = 0;
- mainLayout.marginWidth = 0;
- mainComp.setLayout(mainLayout);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- mainComp.setLayoutData(gd);
- fProgLabel = new Label(mainComp, SWT.NONE);
- fProgLabel.setText("C/C++ Application:");
- gd = new GridData();
- gd.horizontalSpan = 2;
- fProgLabel.setLayoutData(gd);
- fProgText = new Text(mainComp, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- fProgText.setLayoutData(gd);
- fProgText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- });
- fSearchButton = createPushButton(mainComp, "Searc&h...", null);
- fSearchButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleSearchButtonSelected();
- updateLaunchConfigurationDialog();
- }
- });
- LaunchUIPlugin.setDialogShell(parent.getShell());
- }
-
- /**
- * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration config) {
- filterPlatform = getPlatform(config);
- updateProjectFromConfig(config);
- updateProgramFromConfig(config);
-
- }
-
- protected void updateProjectFromConfig(ILaunchConfiguration config) {
- String projectName = EMPTY_STRING;
- try {
- projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING);
- } catch (CoreException ce) {
- LaunchUIPlugin.log(ce);
- }
- fProjText.setText(projectName);
- }
-
- protected void updateProgramFromConfig(ILaunchConfiguration config) {
- String programName = EMPTY_STRING;
- try {
- programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING);
- } catch (CoreException ce) {
- LaunchUIPlugin.log(ce);
- }
- fProgText.setText(programName);
- }
-
- /**
- * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) fProjText.getText());
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) fProgText.getText());
- }
-
- /**
- * Show a dialog that lists all main types
- */
- protected void handleSearchButtonSelected() {
-
- if (getCProject() == null) {
- MessageDialog.openInformation(
- getShell(),
- "Project required",
- "Project must first be entered before searching for a program");
- return;
- }
- ILabelProvider labelProvider = new CElementLabelProvider();
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
- dialog.setElements(getBinaryFiles(getCProject()));
- dialog.setMessage("Choose a &program to run");
- dialog.setTitle("Program Selection");
- if (dialog.open() == ElementListSelectionDialog.OK) {
- IBinary binary = (IBinary) dialog.getFirstResult();
- fProgText.setText(binary.getResource().getProjectRelativePath().toString());
- }
- }
-
- /**
- * Iterate through and suck up all of the executable files that
- * we can find.
- */
- protected IBinary[] getBinaryFiles(final ICProject cproject) {
- final Display display;
- if ( getShell() == null ) {
- display = LaunchUIPlugin.getShell().getDisplay();
- } else {
- display = getShell().getDisplay();
- }
- final Object[] ret = new Object[1];
- BusyIndicator.showWhile(display, new Runnable() {
- public void run() {
- ret[0] = cproject.getBinaryContainer().getBinaries();
- }
- });
-
- return (IBinary[])ret[0];
- }
-
- /**
- * 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);
- }
-
- /**
- * Realize a C Project selection dialog and return the first selected project,
- * or null if there was none.
- */
- protected ICProject chooseCProject() {
- ICProject[] projects;
- projects = getCProjects();
-
- ILabelProvider labelProvider = new CElementLabelProvider();
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
- dialog.setTitle("Project Selection");
- dialog.setMessage("Choose a &project to constrain the search for a program");
- dialog.setElements(projects);
-
- ICProject cProject = getCProject();
- if (cProject != null) {
- dialog.setInitialSelections(new Object[] { cProject });
- }
- if (dialog.open() == ElementListSelectionDialog.OK) {
- return (ICProject) dialog.getFirstResult();
- }
- return null;
- }
-
- /**
- * Return an array a ICProject whose platform match that of the runtime env.
- **/
-
- protected ICProject[] getCProjects() {
- ICProject cproject[] = CoreModel.getDefault().getCModel().getCProjects();
- ArrayList list = new ArrayList(cproject.length);
- boolean isNative = filterPlatform.equals(BootLoader.getOS());
-
- for (int i = 0; i < cproject.length; i++) {
- ICDescriptor cdesciptor = null;
- try {
- cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject) cproject[i].getResource());
- String projectPlatform = cdesciptor.getPlatform();
- if (filterPlatform.equals("*")
- || projectPlatform.equals("*")
- || (isNative && cdesciptor.getPlatform().equalsIgnoreCase("native"))
- || filterPlatform.equalsIgnoreCase(cdesciptor.getPlatform()) == true) {
- list.add(cproject[i]);
- }
- } catch (CoreException e) {
- list.add(cproject[i]);
- }
- }
- return (ICProject[]) list.toArray(new ICProject[list.size()]);
- }
- /**
- * 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);
- }
-
- /**
- * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
-
- setErrorMessage(null);
- setMessage(null);
-
- String name = fProjText.getText().trim();
- if (name.length() == 0) {
- setErrorMessage("Project not specified");
- return false;
- }
- if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
- setErrorMessage("Project does not exist");
- return false;
- }
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
-
- name = fProgText.getText().trim();
- if (name.length() == 0) {
- setErrorMessage("Program not specified");
- return false;
- }
- if (name.equals(".") || name.equals("..")) {
- setErrorMessage("Program does not exist");
- return false;
- }
- if (!project.isOpen()) {
- setErrorMessage("Project must be opened");
- return false;
- }
- if (!project.getFile(name).exists()) {
- setErrorMessage("Program does not exist");
- return false;
- }
- return true;
- }
-
- /**
- * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- // We set empty attributes for project & program so that when one config is
- // compared to another, the existence of empty attributes doesn't cause an
- // incorrect result (the performApply() method can result in empty values
- // for these attributes being set on a config if there is nothing in the
- // corresponding text boxes)
- // plus getContext will use this to base context from if set.
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING);
- ICElement cElement = null;
- cElement = getContext(config, getPlatform(config));
- if (cElement != null) {
- initializeCProject(cElement, config);
- initializeProgramName(cElement, config);
- }
- }
-
- /**
- * Set the program name attributes on the working copy based on the ICElement
- */
- protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) {
- IBinary binary = null;
- if (cElement instanceof ICProject) {
- IBinary[] bins = getBinaryFiles((ICProject) cElement);
- if (bins.length == 1) {
- binary = bins[0];
- }
- }
-
- if (binary != null) {
- String path;
- path = binary.getResource().getProjectRelativePath().toOSString();
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path);
- String name = binary.getElementName();
- int index = name.lastIndexOf('.');
- if (index > 0) {
- name = name.substring(index + 1);
- }
- name = getLaunchConfigurationDialog().generateName(name);
- config.rename(name);
- } else {
- String name = getLaunchConfigurationDialog().generateName(cElement.getCProject().getElementName());
- config.rename(name);
- }
- }
- /**
- * @see ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return "Main";
- }
-
- /**
- * @see ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return LaunchImages.get(LaunchImages.IMG_VIEW_MAIN_TAB);
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
- */
- protected void updateLaunchConfigurationDialog() {
- super.updateLaunchConfigurationDialog();
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java
deleted file mode 100644
index ab1b4042f7b..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *(c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- *
- */
-package org.eclipse.cdt.launch.ui;
-
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
-import org.eclipse.cdt.debug.ui.sourcelookup.SourceLookupBlock;
-import org.eclipse.cdt.launch.internal.ui.LaunchImages;
-import org.eclipse.cdt.launch.sourcelookup.DefaultSourceLocator;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Enter type comment.
- *
- * @since: Feb 13, 2003
- */
-public class CSourceLookupTab extends CLaunchConfigurationTab
-{
- private SourceLookupBlock fBlock = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl( Composite parent )
- {
- Composite control = new Composite( parent, SWT.NONE );
- control.setLayout( new GridLayout() );
- fBlock = new SourceLookupBlock();
- fBlock.createControl( control );
- fBlock.setLaunchConfigurationDialog( getLaunchConfigurationDialog() );
- setControl( control );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults( ILaunchConfigurationWorkingCopy configuration )
- {
- configuration.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, DefaultSourceLocator.ID_DEFAULT_SOURCE_LOCATOR );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom( ILaunchConfiguration configuration )
- {
- IProject project = getProject( configuration );
- IProject oldProject = fBlock.getProject();
- fBlock.setProject( getProject( configuration ) );
- if ( project != null )
- {
- try
- {
- String id = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "" );
- if ( isEmpty( id ) || DefaultSourceLocator.ID_DEFAULT_SOURCE_LOCATOR.equals( id ) )
- {
- DefaultSourceLocator locator = new DefaultSourceLocator();
- String memento = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, "" );
- if ( project.equals( oldProject ) && !isEmpty( memento ) )
- {
- locator.initializeFromMemento( memento );
- }
- else
- {
- locator.initializeDefaults( configuration );
- }
- ICSourceLocator clocator = (ICSourceLocator)locator.getAdapter( ICSourceLocator.class );
- if ( clocator != null )
- fBlock.initialize( clocator );
- }
- }
- catch( CoreException e )
- {
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply( ILaunchConfigurationWorkingCopy configuration )
- {
- configuration.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, DefaultSourceLocator.ID_DEFAULT_SOURCE_LOCATOR );
- IProject project = getProject( configuration );
- if ( project != null )
- {
- DefaultSourceLocator locator = new DefaultSourceLocator();
- try
- {
- locator.initializeDefaults( configuration );
- ICSourceLocator clocator = (ICSourceLocator)locator.getAdapter( ICSourceLocator.class );
- if ( clocator != null )
- {
- if ( !project.equals( fBlock.getProject() ) )
- fBlock.initialize( clocator );
- clocator.setSourceLocations( fBlock.getSourceLocations() );
- }
- configuration.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, locator.getMemento() );
- }
- catch( CoreException e )
- {
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName()
- {
- return "Source";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return LaunchImages.get(LaunchImages.IMG_VIEW_SOURCE_TAB);
- }
-
- private IProject getProject( ILaunchConfiguration configuration )
- {
- IProject project = null;
- try
- {
- String projectName = configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "" );
- if ( !isEmpty( projectName ) )
- project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName );
- }
- catch( CoreException e )
- {
- }
- return project;
- }
-
- private boolean isEmpty( String string )
- {
- return string == null || string.length() == 0;
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java
deleted file mode 100644
index 6d272fad301..00000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * (c) Copyright QNX Software System Ltd. 2002.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.launch.ui;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.ICDescriptor;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.debug.core.CDebugCorePlugin;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-
-public class CorefileDebuggerTab extends AbstractCDebuggerTab {
- protected Combo fDCombo;
-
- private boolean initializingComboBox = false;
-
- public void createControl(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
- GridLayout topLayout = new GridLayout(2, false);
- comp.setLayout(topLayout);
- Label dlabel = new Label(comp, SWT.NONE);
- dlabel.setText("Debugger:");
- fDCombo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY);
- fDCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- handleDebuggerChanged();
- }
- });
- Group debuggerGroup = new Group(comp, SWT.SHADOW_ETCHED_IN);
- debuggerGroup.setText("Debugger Options");
- setDynamicTabHolder(debuggerGroup);
- GridLayout tabHolderLayout = new GridLayout();
- tabHolderLayout.marginHeight = 0;
- tabHolderLayout.marginWidth = 0;
- tabHolderLayout.numColumns = 1;
- getDynamicTabHolder().setLayout(tabHolderLayout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- getDynamicTabHolder().setLayoutData(gd);
- }
-
- protected void loadDebuggerComboBox(ILaunchConfiguration config, String selection) {
- if (initializingComboBox) {
- return;
- }
- initializingComboBox = true;
- ICDebugConfiguration[] debugConfigs;
- String configPlatform = getPlatform(config);
- ICElement ce = getContext(config, null);
- String projectPlatform = "*";
- String projectCPU = "*";
- if (ce != null) {
- try {
- ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject());
- projectPlatform = descriptor.getPlatform();
- IBinary bin = (IBinary) ce;
- projectCPU = bin.getCPU();
- } catch (Exception e) {
- }
- }
- fDCombo.removeAll();
- debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations();
- int x = 0;
- int selndx = -1;
- for (int i = 0; i < debugConfigs.length; i++) {
- if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) {
- String debuggerPlatform = debugConfigs[i].getPlatform();
- boolean platformMatch = configPlatform.equals(projectPlatform);
- if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (platformMatch && projectPlatform.equals("*"))) {
- if (debugConfigs[i].supportsCPU(projectCPU)) {
- fDCombo.add(debugConfigs[i].getName());
- fDCombo.setData(Integer.toString(x), debugConfigs[i]);
- // select first exact matching debugger for platform or requested selection
- if ((selndx == -1 && debuggerPlatform.equalsIgnoreCase(projectPlatform))
- || selection.equals(debugConfigs[i].getID())) {
- selndx = x;
- }
- x++;
- }
- }
- }
- }
- // if no selection meaning nothing in config the force initdefault on tab
- setInitializeDefault(selection.equals("") ? true : false);
-
- fDCombo.select(selndx == -1 ? 0 : selndx);
- //The behaviour is undefined for if the callbacks should be triggered for this,
- //so to avoid unnecessary confusion, we force an update.
- handleDebuggerChanged();
- fDCombo.getParent().layout(true);
- initializingComboBox = false;
- }
-
- public void initializeFrom(ILaunchConfiguration config) {
- super.initializeFrom(config);
- try {
- String id = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "");
- if (getDebugConfig() == null || !getDebugConfig().getID().equals(id)) {
- loadDebuggerComboBox(config, id);
- }
- } catch (CoreException e) {
- return;
- }
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- super.setDefaults(config);
- config.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE);
- }
-
- public boolean isValid(ILaunchConfiguration config) {
- if (!validateDebuggerConfig(config)) {
- setErrorMessage("No debugger available");
- return false;
- }
- return super.isValid(config);
- }
-
- private boolean validateDebuggerConfig(ILaunchConfiguration config) {
- String platform = getPlatform(config);
- ICElement ce = getContext(config, null);
- String projectPlatform = "*";
- String projectCPU = "*";
- if (ce != null) {
- try {
- ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject());
- projectPlatform = descriptor.getPlatform();
- IBinary bin = (IBinary) ce;
- projectCPU = bin.getCPU();
- } catch (Exception e) {
- }
- }
- ICDebugConfiguration debugConfig = getDebugConfig();
- if (debugConfig == null) {
- return false;
- }
- String debuggerPlatform = debugConfig.getPlatform();
- boolean platformMatch = platform.equals(projectPlatform);
- if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (platformMatch && projectPlatform.equals("*"))) {
- if (debugConfig.supportsCPU(projectCPU)) {
- return true;
- }
- }
- setDebugConfig(null);
- return false;
- }
-
- /**
- * Return the class that implements <code>ILaunchConfigurationTab</code>
- * that is registered against the debugger id of the currently selected debugger.
- */
- protected ICDebugConfiguration getConfigForCurrentDebugger() {
- int selectedIndex = fDCombo.getSelectionIndex();
- return (ICDebugConfiguration) fDCombo.getData(Integer.toString(selectedIndex));
- }
-
- /**
- * @see org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab#handleDebuggerChanged()
- */
- protected void handleDebuggerChanged() {
- super.handleDebuggerChanged();
- }
-
-}

Back to the top