1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00

externed strings patch from jciesiel@ca.ibm.com

This commit is contained in:
David Inglis 2004-03-09 20:42:41 +00:00
parent 89a619d39c
commit e18d7494d0
18 changed files with 346 additions and 155 deletions

View file

@ -1,3 +1,25 @@
2004-03-01 James Ciesielski
Marked those strings that are non-translatable as such and
externalized those strings that can be translated.
* src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.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/CoreFileCLaunchConfigurationTab.java
* src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
* src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
* src/org/eclipse/cdt/launch/internal/ui/LaunchUIPluginResources.properties
* 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
* src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java
2004-02-18 Alain Magloire 2004-02-18 Alain Magloire
filterClass contribution to be able to use filterClass contribution to be able to use

View file

@ -68,7 +68,7 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
Entry entry; Entry entry;
for (int i = 0; entries.hasNext() && i < array.length; i++) { for (int i = 0; entries.hasNext() && i < array.length; i++) {
entry = (Entry) entries.next(); entry = (Entry) entries.next();
array[i] = ((String) entry.getKey()) + "=" + ((String) entry.getValue()); array[i] = ((String) entry.getKey()) + "=" + ((String) entry.getValue()); //$NON-NLS-1$
} }
return array; return array;
} }
@ -247,7 +247,7 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
*/ */
protected void abort(String message, Throwable exception, int code) throws CoreException { protected void abort(String message, Throwable exception, int code) throws CoreException {
MultiStatus status = new MultiStatus(getPluginID(),code, message,exception); MultiStatus status = new MultiStatus(getPluginID(),code, message,exception);
status.add(new Status(IStatus.ERROR,getPluginID(),code, exception == null ? "" : exception.getLocalizedMessage(),exception)); status.add(new Status(IStatus.ERROR,getPluginID(),code, exception == null ? "" : exception.getLocalizedMessage(),exception)); //$NON-NLS-1$
throw new CoreException(status); throw new CoreException(status);
} }
@ -296,7 +296,7 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
if (id == null) { if (id == null) {
ICProject cProject = getCProject(configuration); ICProject cProject = getCProject(configuration);
if (cProject == null) { if (cProject == null) {
abort("Project does not exist", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); abort(LaunchUIPlugin.getResourceString("Launch.common.Project_does_not_exist"), null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); //$NON-NLS-1$
} }
sourceLocator = CDebugUIPlugin.createDefaultSourceLocator(); sourceLocator = CDebugUIPlugin.createDefaultSourceLocator();
sourceLocator.initializeDefaults(configuration); sourceLocator.initializeDefaults(configuration);
@ -345,7 +345,7 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
try { try {
dbgCfg = dbgCfg =
CDebugCorePlugin.getDefault().getDebugConfiguration( CDebugCorePlugin.getDefault().getDebugConfiguration(
config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "")); config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "")); //$NON-NLS-1$
} }
catch (CoreException e) { catch (CoreException e) {
IStatus status = IStatus status =
@ -353,7 +353,7 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
IStatus.ERROR, IStatus.ERROR,
LaunchUIPlugin.getUniqueIdentifier(), LaunchUIPlugin.getUniqueIdentifier(),
ICDTLaunchConfigurationConstants.ERR_DEBUGGER_NOT_INSTALLED, ICDTLaunchConfigurationConstants.ERR_DEBUGGER_NOT_INSTALLED,
"CDT Debubger not installed", LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Debugger_not_installed"), //$NON-NLS-1$
e); e);
IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status); IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status);
@ -369,13 +369,13 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
} }
protected String renderTargetLabel(ICDebugConfiguration debugConfig) { protected String renderTargetLabel(ICDebugConfiguration debugConfig) {
String format = "{0} ({1})"; String format = "{0} ({1})"; //$NON-NLS-1$
String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis())); String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
return MessageFormat.format(format, new String[] { debugConfig.getName(), timestamp }); return MessageFormat.format(format, new String[] { debugConfig.getName(), timestamp });
} }
protected String renderProcessLabel(String commandLine) { protected String renderProcessLabel(String commandLine) {
String format = "{0} ({1})"; String format = "{0} ({1})"; //$NON-NLS-1$
String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis())); String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
return MessageFormat.format(format, new String[] { commandLine, timestamp }); return MessageFormat.format(format, new String[] { commandLine, timestamp });
} }
@ -383,18 +383,18 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException { protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException {
String name = getProjectName(config); String name = getProjectName(config);
if (name == null) { if (name == null) {
abort("C Project not specified", null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT); abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.C_Project_not_specified"), null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT); //$NON-NLS-1$
} }
ICProject cproject = getCProject(config); ICProject cproject = getCProject(config);
if (cproject == null) { if (cproject == null) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
if (!project.exists()) { if (!project.exists()) {
abort("Project '"+ name + "' does not exist", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); abort( LaunchUIPlugin.getFormattedResourceString("AbstractCLaunchDelegate.Project_NAME_does_not_exist", name), null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); //$NON-NLS-1$
} }
else if (!project.isOpen()) { else if (!project.isOpen()) {
abort("Project '"+ name + "' is closed", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); abort( LaunchUIPlugin.getFormattedResourceString("AbstractCLaunchDelegate.Project_NAME_is_closed", name), null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); //$NON-NLS-1$
} }
abort("Project is not a C/C++ project", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Not_a_C_CPP_project"), null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); //$NON-NLS-1$
} }
return cproject; return cproject;
} }
@ -403,12 +403,12 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
ICProject cproject = verifyCProject(config); ICProject cproject = verifyCProject(config);
String fileName = getProgramName(config); String fileName = getProgramName(config);
if (fileName == null) { if (fileName == null) {
abort("Program file not specified", null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM); abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Program_file_not_specified"), null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM); //$NON-NLS-1$
} }
IFile programPath = ((IProject) cproject.getResource()).getFile(fileName); IFile programPath = ((IProject) cproject.getResource()).getFile(fileName);
if (programPath == null || !programPath.exists() || !programPath.getLocation().toFile().exists()) { if (programPath == null || !programPath.exists() || !programPath.getLocation().toFile().exists()) {
abort("Program file does not exist", new FileNotFoundException(programPath.getLocation() + " not found."), ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST); abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Program_file_does_not_exist"), new FileNotFoundException(LaunchUIPlugin.getFormattedResourceString("AbstractCLaunchDelegate.PROGRAM_PATH_not_found", programPath.getLocation().toOSString())), ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST); //$NON-NLS-1$ //$NON-NLS-2$
} }
return programPath; return programPath;
} }
@ -445,8 +445,8 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
} }
else { else {
abort( abort(
"Working directory does not exist", LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Working_directory_does_not_exist"), //$NON-NLS-1$
new FileNotFoundException(path.toOSString() + " not found."), new FileNotFoundException( LaunchUIPlugin.getFormattedResourceString("AbstractCLaunchDelegate.PROGRAM_PATH_not_found", path.toOSString())), //$NON-NLS-1$
ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST); ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
} }
} }
@ -457,8 +457,8 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
} }
else { else {
abort( abort(
"Working directory does not exist", LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Working_directory_does_not_exist"), //$NON-NLS-1$
new FileNotFoundException(path.toOSString() + "Does not exsit."), new FileNotFoundException( LaunchUIPlugin.getFormattedResourceString("AbstractCLaunchDelegate.PROGRAM_PATH_does_not_exist", path.toOSString())), //$NON-NLS-1$
ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST); ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
} }
} }

View file

@ -118,7 +118,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut, ILaunchFilte
String os = BootLoader.getOS(); String os = BootLoader.getOS();
for (int i = 0; i < debugConfigs.length; i++) { for (int i = 0; i < debugConfigs.length; i++) {
String platform = debugConfigs[i].getPlatform(); String platform = debugConfigs[i].getPlatform();
if (platform == null || platform.equals("native") || platform.equals(os)) { if (platform == null || platform.equals(ICDebugConfiguration.PLATFORM_NATIVE) || platform.equals(os)) {
debugList.add(debugConfigs[i]); debugList.add(debugConfigs[i]);
} }
} }
@ -203,7 +203,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut, ILaunchFilte
*/ */
public String getText(Object element) { public String getText(Object element) {
if (element == null) { if (element == null) {
return ""; return ""; //$NON-NLS-1$
} else if (element instanceof ICDebugConfiguration) { } else if (element instanceof ICDebugConfiguration) {
return ((ICDebugConfiguration) element).getName(); return ((ICDebugConfiguration) element).getName();
} }
@ -304,8 +304,8 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut, ILaunchFilte
dialog.setElements(binList.toArray()); dialog.setElements(binList.toArray());
dialog.setTitle(getBinarySelectionDialogTitleString(binList, mode)); //$NON-NLS-1$ dialog.setTitle(getBinarySelectionDialogTitleString(binList, mode)); //$NON-NLS-1$
dialog.setMessage(getBinarySelectionDialogMessageString(binList, mode)); //$NON-NLS-1$ dialog.setMessage(getBinarySelectionDialogMessageString(binList, mode)); //$NON-NLS-1$
dialog.setUpperListLabel("Binaries:"); dialog.setUpperListLabel(LaunchUIPlugin.getResourceString("Launch.common.BinariesColon")); //$NON-NLS-1$
dialog.setLowerListLabel("Qualifier:"); dialog.setLowerListLabel(LaunchUIPlugin.getResourceString("Launch.common.QualifierColon")); //$NON-NLS-1$
dialog.setMultipleSelection(false); dialog.setMultipleSelection(false);
if (dialog.open() == ElementListSelectionDialog.OK) { if (dialog.open() == ElementListSelectionDialog.OK) {
return (IBinary) dialog.getFirstResult(); return (IBinary) dialog.getFirstResult();
@ -376,12 +376,12 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut, ILaunchFilte
} catch (InterruptedException e) { } catch (InterruptedException e) {
return; return;
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
MessageDialog.openError(getShell(), "Application Launcher", e.getMessage()); MessageDialog.openError(getShell(), LaunchUIPlugin.getResourceString("CApplicationLaunchShortcut.Application_Launcher"), e.getMessage()); //$NON-NLS-1$
return; return;
} }
int count = results.size(); int count = results.size();
if (count == 0) { if (count == 0) {
MessageDialog.openError(getShell(), "Application Launcher", "Launch failed no binaries"); MessageDialog.openError(getShell(), LaunchUIPlugin.getResourceString("CApplicationLaunchShortcut.Application_Launcher"), LaunchUIPlugin.getResourceString("CApplicationLaunchShortcut.Launch_failed_no_binaries")); //$NON-NLS-1$ //$NON-NLS-2$
} else if (count > 1) { } else if (count > 1) {
bin = chooseBinary(results, mode); bin = chooseBinary(results, mode);
} else { } else {
@ -392,7 +392,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut, ILaunchFilte
launch(bin, mode); launch(bin, mode);
} }
} else { } else {
MessageDialog.openError(getShell(), "Application Launcher", "Launch failed no project selected"); MessageDialog.openError(getShell(), LaunchUIPlugin.getResourceString("CApplicationLaunchShortcut.Application_Launcher"), LaunchUIPlugin.getResourceString("CApplicationLaunchShortcut.Launch_failed_no_project_selected")); //$NON-NLS-1$ //$NON-NLS-2$
} }
} }

View file

@ -36,7 +36,7 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
monitor = new NullProgressMonitor(); monitor = new NullProgressMonitor();
} }
monitor.beginTask("Launching postmortem debugger", IProgressMonitor.UNKNOWN); monitor.beginTask(LaunchUIPlugin.getResourceString("CoreFileLaunchDelegate.Launching_postmortem_debugger"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
// check for cancellation // check for cancellation
if (monitor.isCanceled()) { if (monitor.isCanceled()) {
return; return;
@ -49,7 +49,7 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
IPath corefile = getCoreFilePath((IProject) cproject.getResource()); IPath corefile = getCoreFilePath((IProject) cproject.getResource());
if (corefile == null) { if (corefile == null) {
cancel("No Corefile selected", ICDTLaunchConfigurationConstants.ERR_NO_COREFILE); cancel(LaunchUIPlugin.getResourceString("CoreFileLaunchDelegate.No_Corefile_selected"), ICDTLaunchConfigurationConstants.ERR_NO_COREFILE); //$NON-NLS-1$
} }
Process debugger = null; Process debugger = null;
IProcess debuggerProcess = null; IProcess debuggerProcess = null;
@ -57,10 +57,10 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
dsession = debugConfig.getDebugger().createCoreSession(config, exeFile, corefile); dsession = debugConfig.getDebugger().createCoreSession(config, exeFile, corefile);
debugger = dsession.getSessionProcess(); debugger = dsession.getSessionProcess();
} catch (CDIException e) { } catch (CDIException e) {
abort("Failed Launching CDI Debugger", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); abort(LaunchUIPlugin.getResourceString("CoreFileLaunchDelegate.Failed_Launching_CDI_Debugger"), e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); //$NON-NLS-1$
} }
if ( debugger != null ) { if ( debugger != null ) {
debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); //$NON-NLS-1$
launch.removeProcess(debuggerProcess); launch.removeProcess(debuggerProcess);
} }
// set the source locator // set the source locator
@ -80,20 +80,20 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
final Shell shell = LaunchUIPlugin.getShell(); final Shell shell = LaunchUIPlugin.getShell();
final String res[] = { null }; final String res[] = { null };
if (shell == null) { if (shell == null) {
abort("No Shell available in Launch", null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); abort(LaunchUIPlugin.getResourceString("CoreFileLaunchDelegate.No_Shell_available_in_Launch"), null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); //$NON-NLS-1$
} }
Display display = shell.getDisplay(); Display display = shell.getDisplay();
display.syncExec(new Runnable() { display.syncExec(new Runnable() {
public void run() { public void run() {
FileDialog dialog = new FileDialog(shell); FileDialog dialog = new FileDialog(shell);
dialog.setText("Select Corefile"); dialog.setText(LaunchUIPlugin.getResourceString("CoreFileLaunchDelegate.Select_Corefile")); //$NON-NLS-1$
String initPath = null; String initPath = null;
try { try {
initPath = project.getPersistentProperty(new QualifiedName(LaunchUIPlugin.getUniqueIdentifier(), "SavePath")); initPath = project.getPersistentProperty(new QualifiedName(LaunchUIPlugin.getUniqueIdentifier(), "SavePath")); //$NON-NLS-1$
} catch (CoreException e) { } catch (CoreException e) {
} }
if (initPath == null || initPath.equals("")) { if (initPath == null || initPath.equals("")) { //$NON-NLS-1$
initPath = project.getLocation().toString(); initPath = project.getLocation().toString();
} }
dialog.setFilterPath(initPath); dialog.setFilterPath(initPath);

View file

@ -60,7 +60,7 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
monitor = new NullProgressMonitor(); monitor = new NullProgressMonitor();
} }
monitor.beginTask("Launching Local C Application", IProgressMonitor.UNKNOWN); monitor.beginTask(LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.Launching_Local_C_Application"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
// check for cancellation // check for cancellation
if (monitor.isCanceled()) { if (monitor.isCanceled()) {
return; return;
@ -99,7 +99,7 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
IProcess iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0])); IProcess iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0]));
debugger = dsession.getSessionProcess(); debugger = dsession.getSessionProcess();
if ( debugger != null ) { if ( debugger != null ) {
debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); //$NON-NLS-1$
launch.removeProcess(debuggerProcess); launch.removeProcess(debuggerProcess);
} }
boolean stopInMain = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); boolean stopInMain = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false);
@ -117,12 +117,12 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
} else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) {
int pid = getProcessID(); int pid = getProcessID();
if (pid == -1) { if (pid == -1) {
cancel("No Process ID selected", ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID); cancel(LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.No_Process_ID_selected"), ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID); //$NON-NLS-1$
} }
dsession = debugConfig.getDebugger().createAttachSession(config, exeFile, pid); dsession = debugConfig.getDebugger().createAttachSession(config, exeFile, pid);
debugger = dsession.getSessionProcess(); debugger = dsession.getSessionProcess();
if ( debugger != null ) { if ( debugger != null ) {
debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); //$NON-NLS-1$
launch.removeProcess(debuggerProcess); launch.removeProcess(debuggerProcess);
} }
CDebugModel.newAttachDebugTarget( CDebugModel.newAttachDebugTarget(
@ -133,12 +133,12 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
exeFile); exeFile);
} }
} catch (CDIException e) { } catch (CDIException e) {
abort("Failed Launching CDI Debugger", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); abort(LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.Failed_Launching_CDI_Debugger"), e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); //$NON-NLS-1$
} }
} else { } else {
File wd = getWorkingDirectory(config); File wd = getWorkingDirectory(config);
if (wd == null) { if (wd == null) {
wd = new File(System.getProperty("user.home", ".")); //NON-NLS-1; wd = new File(System.getProperty("user.home", ".")); //NON-NLS-1; //$NON-NLS-1$//$NON-NLS-2$
} }
Process process = exec(commandArray, getEnvironmentProperty(config), wd); Process process = exec(commandArray, getEnvironmentProperty(config), wd);
DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0])); DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0]));
@ -152,7 +152,7 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
final Shell shell = LaunchUIPlugin.getShell(); final Shell shell = LaunchUIPlugin.getShell();
final int pid[] = { -1 }; final int pid[] = { -1 };
if (shell == null) { if (shell == null) {
abort("No Shell availible in Launch", null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); abort(LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.No_Shell_available_in_Launch"), null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); //$NON-NLS-1$
} }
Display display = shell.getDisplay(); Display display = shell.getDisplay();
display.syncExec(new Runnable() { display.syncExec(new Runnable() {
@ -164,7 +164,7 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
public String getText(Object element) { public String getText(Object element) {
IProcessInfo info = (IProcessInfo)element; IProcessInfo info = (IProcessInfo)element;
IPath path = new Path(info.getName()); IPath path = new Path(info.getName());
return path.lastSegment() + " - " + info.getPid(); return path.lastSegment() + " - " + info.getPid(); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
@ -186,11 +186,11 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
} }
}; };
TwoPaneElementSelector dialog = new TwoPaneElementSelector(shell, provider, qprovider); TwoPaneElementSelector dialog = new TwoPaneElementSelector(shell, provider, qprovider);
dialog.setTitle("Select Process"); dialog.setTitle(LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.Select_Process")); //$NON-NLS-1$
dialog.setMessage("Select a Process to attach debugger to:"); dialog.setMessage(LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.Select_Process_to_attach_debugger_to")); //$NON-NLS-1$
IProcessList plist = CCorePlugin.getDefault().getProcessList(); IProcessList plist = CCorePlugin.getDefault().getProcessList();
if (plist == null) { if (plist == null) {
MessageDialog.openError(shell, "CDT Launch Error", "Current platform does not support listing processes"); MessageDialog.openError(shell, LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.CDT_Launch_Error"), LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.Platform_cannot_list_processes")); //$NON-NLS-1$ //$NON-NLS-2$
return; return;
} }
dialog.setElements(plist.getProcessList()); dialog.setElements(plist.getProcessList());
@ -229,7 +229,7 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
if (names != null) { if (names != null) {
while (names.hasMoreElements()) { while (names.hasMoreElements()) {
String key = (String) names.nextElement(); String key = (String) names.nextElement();
envList.add(key + "=" + props.getProperty(key)); envList.add(key + "=" + props.getProperty(key)); //$NON-NLS-1$
} }
envp = (String[]) envList.toArray(new String[envList.size()]); envp = (String[]) envList.toArray(new String[envList.size()]);
} }
@ -244,7 +244,7 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
if (p != null) { if (p != null) {
p.destroy(); p.destroy();
} }
abort("Error starting process", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); abort(LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.Error_starting_process"), e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); //$NON-NLS-1$
} catch (NoSuchMethodError e) { } catch (NoSuchMethodError e) {
//attempting launches on 1.2.* - no ability to set working directory //attempting launches on 1.2.* - no ability to set working directory
@ -253,7 +253,7 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
IStatus.ERROR, IStatus.ERROR,
LaunchUIPlugin.getUniqueIdentifier(), LaunchUIPlugin.getUniqueIdentifier(),
ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_NOT_SUPPORTED, ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_NOT_SUPPORTED,
"Eclipse runtime does not support working directory", LaunchUIPlugin.getResourceString("LocalCLaunchConfigurationDelegate.Does_not_support_working_dir"), //$NON-NLS-1$
e); e);
IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status); IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status);

View file

@ -193,7 +193,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
setErrorMessage(null); setErrorMessage(null);
setMessage(null); setMessage(null);
if (getDebugConfig() == null) { if (getDebugConfig() == null) {
setErrorMessage("No debugger available"); setErrorMessage(LaunchUIPlugin.getResourceString("AbstractCDebuggerTab.No_debugger_available")); //$NON-NLS-1$
return false; return false;
} }
@ -217,7 +217,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
} }
public String getName() { public String getName() {
return "Debugger"; return LaunchUIPlugin.getResourceString("AbstractCDebuggerTab.Debugger"); //$NON-NLS-1$
} }
} }

View file

@ -32,7 +32,7 @@ public class CoreFileCLaunchConfigurationTabGroup extends AbstractLaunchConfigur
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
// This configuration should work for all platforms // This configuration should work for all platforms
configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, "*"); configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, "*"); //$NON-NLS-1$
super.setDefaults(configuration); super.setDefaults(configuration);
} }

View file

@ -23,20 +23,20 @@ public class LaunchImages {
private static URL fgIconBaseURL; private static URL fgIconBaseURL;
static { static {
try { try {
fgIconBaseURL= new URL(LaunchUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" ); fgIconBaseURL= new URL(LaunchUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" ); //$NON-NLS-1$
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
//LaunchUIPlugin.getDefault().log(e); //LaunchUIPlugin.getDefault().log(e);
} }
} }
private static final String T_TABS = "tabs/"; private static final String T_TABS = "tabs/"; //$NON-NLS-1$
private static final String T_OBJS = "obj16/"; private static final String T_OBJS = "obj16/"; //$NON-NLS-1$
public static String IMG_VIEW_MAIN_TAB = NAME_PREFIX + "main_tab.gif"; public static String IMG_VIEW_MAIN_TAB = NAME_PREFIX + "main_tab.gif"; //$NON-NLS-1$
public static String IMG_VIEW_ARGUMENTS_TAB = NAME_PREFIX + "arguments_tab.gif"; public static String IMG_VIEW_ARGUMENTS_TAB = NAME_PREFIX + "arguments_tab.gif"; //$NON-NLS-1$
public static String IMG_VIEW_ENVIRONMENT_TAB = NAME_PREFIX + "environment_tab.gif"; public static String IMG_VIEW_ENVIRONMENT_TAB = NAME_PREFIX + "environment_tab.gif"; //$NON-NLS-1$
public static String IMG_VIEW_DEBUGGER_TAB = NAME_PREFIX + "debugger_tab.gif"; public static String IMG_VIEW_DEBUGGER_TAB = NAME_PREFIX + "debugger_tab.gif"; //$NON-NLS-1$
public static String IMG_VIEW_SOURCE_TAB = NAME_PREFIX + "source_tab.gif"; public static String IMG_VIEW_SOURCE_TAB = NAME_PREFIX + "source_tab.gif"; //$NON-NLS-1$
public static final ImageDescriptor DESC_TAB_MAIN= createManaged(T_TABS, IMG_VIEW_MAIN_TAB); 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_ARGUMENTS = createManaged(T_TABS, IMG_VIEW_ARGUMENTS_TAB);
@ -44,7 +44,7 @@ public class LaunchImages {
public static final ImageDescriptor DESC_TAB_DEBUGGER = createManaged(T_TABS, IMG_VIEW_DEBUGGER_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 final ImageDescriptor DESC_TAB_SOURCE = createManaged(T_TABS, IMG_VIEW_SOURCE_TAB);
public static String IMG_OBJS_EXEC= NAME_PREFIX + "exec_obj.gif"; public static String IMG_OBJS_EXEC= NAME_PREFIX + "exec_obj.gif"; //$NON-NLS-1$
public static final ImageDescriptor DESC_OBJS_EXEC = createManaged(T_OBJS, IMG_OBJS_EXEC); public static final ImageDescriptor DESC_OBJS_EXEC = createManaged(T_OBJS, IMG_OBJS_EXEC);
public static void initialize() { public static void initialize() {

View file

@ -17,6 +17,12 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.plugin.AbstractUIPlugin;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.text.MessageFormat;
/* /*
* (c) Copyright QNX Software Systems Ltd. 2002. * (c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved. * All Rights Reserved.
@ -25,6 +31,22 @@ public class LaunchUIPlugin extends AbstractUIPlugin
implements IDebugEventSetListener { implements IDebugEventSetListener {
public static final String PLUGIN_ID = LaunchUIPlugin.getUniqueIdentifier(); public static final String PLUGIN_ID = LaunchUIPlugin.getUniqueIdentifier();
private static final String BUNDLE_NAME = "org.eclipse.cdt.launch.internal.ui.LaunchUIPluginResources";//$NON-NLS-1$
private static ResourceBundle resourceBundle = null;
// -------- static methods --------
static {
if ( resourceBundle == null ) {
// Acquire a reference to the .properties file for this plug-in
try {
resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
} catch (MissingResourceException e) {
resourceBundle = null;
}
}
}
/** /**
* Launch UI plug-in instance * Launch UI plug-in instance
*/ */
@ -149,7 +171,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin
log(status); log(status);
Shell shell = getActiveWorkbenchShell(); Shell shell = getActiveWorkbenchShell();
if (shell != null) { if (shell != null) {
ErrorDialog.openError(shell, "Error", message, status); ErrorDialog.openError(shell, LaunchUIPlugin.getResourceString("LaunchUIPlugin.Error"), message, status); //$NON-NLS-1$
} }
} }
@ -158,7 +180,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin
Shell shell = getActiveWorkbenchShell(); Shell shell = getActiveWorkbenchShell();
if (shell != null) { if (shell != null) {
IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), 1, t.getMessage(), null); //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), 1, t.getMessage(), null); //$NON-NLS-1$
ErrorDialog.openError(shell, "Error", message, status); ErrorDialog.openError(shell, LaunchUIPlugin.getResourceString("LaunchUIPlugin.Error"), message, status); //$NON-NLS-1$
} }
} }
/** /**
@ -204,6 +226,40 @@ public class LaunchUIPlugin extends AbstractUIPlugin
} }
} }
} }
} }
/**
* Returns the plugin's resource bundle,
*/
public ResourceBundle getResourceBundle() {
return resourceBundle;
}
public static String getResourceString(String key) {
ResourceBundle bundle = LaunchUIPlugin.getDefault().getResourceBundle();
// No point trying if bundle is null as exceptions are costly
if ( bundle != null )
{
try {
return bundle.getString(key);
} catch (MissingResourceException e) {
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
} catch (NullPointerException e) {
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
// If we get here, then bundle is null.
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
}
public static String getFormattedResourceString(String key, String arg) {
return MessageFormat.format(getResourceString(key), new String[] { arg });
}
public static String getFormattedResourceString(String key, String[] args) {
return MessageFormat.format(getResourceString(key), args);
}
} }

View file

@ -0,0 +1,105 @@
AbstractCLaunchDelegate.Debugger_not_installed=CDT Debugger not installed
AbstractCLaunchDelegate.C_Project_not_specified=C Project not specified
AbstractCLaunchDelegate.Not_a_C_CPP_project=Project is not a C/C++ project
AbstractCLaunchDelegate.Program_file_not_specified=Program file not specified
AbstractCLaunchDelegate.Program_file_does_not_exist=Program file does not exist
AbstractCLaunchDelegate.Working_directory_does_not_exist=Working directory does not exist
AbstractCLaunchDelegate.Project_NAME_does_not_exist=Project {0} does not exist
AbstractCLaunchDelegate.Project_NAME_is_closed=Project {0} is closed
AbstractCLaunchDelegate.PROGRAM_PATH_not_found={0} not found
AbstractCLaunchDelegate.PROGRAM_PATH_does_not_exist={0} Does not exist.
LocalCLaunchConfigurationDelegate.Launching_Local_C_Application=Launching Local C Application
LocalCLaunchConfigurationDelegate.No_Process_ID_selected=No Process ID selected
LocalCLaunchConfigurationDelegate.Failed_Launching_CDI_Debugger=Failed Launching CDI Debugger
LocalCLaunchConfigurationDelegate.No_Shell_available_in_Launch=No Shell available in Launch
LocalCLaunchConfigurationDelegate.Select_Process=Select Process
LocalCLaunchConfigurationDelegate.CDT_Launch_Error=CDT Launch Error
LocalCLaunchConfigurationDelegate.Platform_cannot_list_processes=Current platform does not support listing processes
LocalCLaunchConfigurationDelegate.Error_starting_process=Error starting process
LocalCLaunchConfigurationDelegate.Does_not_support_working_dir=Eclipse runtime does not support working directory
LocalCLaunchConfigurationDelegate.Select_Process_to_attach_debugger_to=Select a Process to attach debugger to:
CoreFileLaunchDelegate.Launching_postmortem_debugger=Launching postmortem debugger
CoreFileLaunchDelegate.No_Corefile_selected=No Corefile selected
CoreFileLaunchDelegate.Failed_Launching_CDI_Debugger=Failed Launching CDI Debugger
CoreFileLaunchDelegate.No_Shell_available_in_Launch=No Shell available in Launch
CoreFileLaunchDelegate.Select_Corefile=Select Corefile
CApplicationLaunchShortcut.Application_Launcher=Application Launcher
CApplicationLaunchShortcut.Launch_failed_no_binaries=Launch failed no binaries
CApplicationLaunchShortcut.Launch_failed_no_project_selected=Launch failed no project selected
AbstractCDebuggerTab.No_debugger_available=No debugger available
AbstractCDebuggerTab.Debugger=Debugger
LaunchUIPlugin.Error=Error
CSourceLookupTab.Source=Source
CorefileDebuggerTab.Debugger_Options=Debugger Options
CorefileDebuggerTab.No_debugger_available=No debugger available
CMainTab.Project_required=Project required
CMainTab.Enter_project_before_searching_for_program=Project must first be entered before searching for a program
CMainTab.Program_Selection=Program Selection
CMainTab.Enter_project_before_browsing_for_program=Project must first be entered before browsing for a program
CMainTab.Program_selection=Program selection
CMainTab.Selection_must_be_file=Selection must be a file
CMainTab.Selection_must_be_binary_file=Selection must be a binary file
CMainTab.Project_Selection=Project Selection
CMainTab.Choose_project_to_constrain_search_for_program=Choose a &project to constrain the search for a program
CMainTab.Project_not_specified=Project not specified
CMainTab.Program_not_specified=Program not specified
CMainTab.Project_must_be_opened=Project must be opened
CMainTab.Program_does_not_exist=Program does not exist
CMainTab.Main=Main
CMainTab.&ProjectColon=&Project:
CMainTab.C/C++_Application=C/C++ Application:
CMainTab.Search...=Searc&h...
CMainTab.Choose_program_to_run=Choose a &program to run:
CMainTab.Choose_program_to_run_from_NAME=Choose a program to run from {0}:
CDebuggerTab.Run_program_in_debugger=Run program in debugger.
CDebuggerTab.Attach_to_running_process=Attach to running process.
CDebuggerTab.Stop_at_main_on_startup=Stop at main() on startup.
CDebuggerTab.Automatically_track_values_of_variables=Automatically track the values of variables.
CDebuggerTab.Debugger_Options=Debugger Options
CDebuggerTab.No_debugger_available=No debugger available
CDebuggerTab.Select_Debug_mode=Select a Debug mode.
CEnvironmentTab.Edit_Variable=Edit Variable
CEnvironmentTab.New_Variable=New Variable
CEnvironmentTab.NameColon=Name:
CEnvironmentTab.ValueColon=Value:
CEnvironmentTab.Name=Name
CEnvironmentTab.Value=Value
CEnvironmentTab.New...=New...
CEnvironmentTab.Import...=Import...
CEnvironmentTab.Edit...=Edit...
CEnvironmentTab.Remove=Remove
CEnvironmentTab.Environment=Environment
CEnvironmentTab.Existing_Environment_Variable=Existing Environment Variable
CEnvironmentTab.Environment_variable_NAME_exists=Environment variable \" {0} \" exists.\nDo you want to overwrite?
CArgumentsTab.C/C++_Program_Arguments=C/C++ Program Arguments:
CArgumentsTab.Arguments=Arguments
WorkingDirectoryBlock.Wor&king_directory=Wor&king directory:
WorkingDirectoryBlock.Use_de&fault_working_directory=Use de&fault working directory
WorkingDirectoryBlock.&Local_directory=&Local directory
WorkingDirectoryBlock.Works&pace=Works&pace
WorkingDirectoryBlock.Select_&working_directory_for_launch_configuration=Select a &working directory for the launch configuration
WorkingDirectoryBlock.Select_&workspace_relative_working_directory=Select a &workspace relative working directory
WorkingDirectoryBlock.Working_directory_does_not_exist=Working directory does not exist
WorkingDirectoryBlock.Working_directory_is_not_a_directory=Working directory is not a directory
WorkingDirectoryBlock.Project_or_folder_does_not_exist=Specified project or folder does not exist.
WorkingDirectoryBlock.Working_Directory=Working Directory
Launch.common.Exception_occurred_reading_configuration_EXCEPTION=Exception occurred reading configuration {0}
Launch.common.DebuggerColon=Debugger:
Launch.common.BinariesColon=Binaries:
Launch.common.QualifierColon=Qualifier:
Launch.common.B&rowse...=B&rowse...
Launch.common.Project_does_not_exist=Project does not exist

View file

@ -75,13 +75,13 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
setControl(workingDirComp); setControl(workingDirComp);
fWorkingDirLabel = new Label(workingDirComp, SWT.NONE); fWorkingDirLabel = new Label(workingDirComp, SWT.NONE);
fWorkingDirLabel.setText("Wor&king directory:"); fWorkingDirLabel.setText(LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Wor&king_directory")); //$NON-NLS-1$
gd = new GridData(); gd = new GridData();
gd.horizontalSpan = 3; gd.horizontalSpan = 3;
fWorkingDirLabel.setLayoutData(gd); fWorkingDirLabel.setLayoutData(gd);
fUseDefaultWorkingDirButton = new Button(workingDirComp,SWT.CHECK); fUseDefaultWorkingDirButton = new Button(workingDirComp,SWT.CHECK);
fUseDefaultWorkingDirButton.setText("Use de&fault working directory"); fUseDefaultWorkingDirButton.setText(LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Use_de&fault_working_directory")); //$NON-NLS-1$
gd = new GridData(); gd = new GridData();
gd.horizontalSpan = 3; gd.horizontalSpan = 3;
fUseDefaultWorkingDirButton.setLayoutData(gd); fUseDefaultWorkingDirButton.setLayoutData(gd);
@ -91,7 +91,7 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
} }
}); });
fLocalDirButton = createRadioButton(workingDirComp, "&Local directory"); fLocalDirButton = createRadioButton(workingDirComp, LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.&Local_directory")); //$NON-NLS-1$
fLocalDirButton.addSelectionListener(new SelectionAdapter() { fLocalDirButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleLocationButtonSelected(); handleLocationButtonSelected();
@ -107,14 +107,14 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
} }
}); });
fWorkingDirBrowseButton = createPushButton(workingDirComp, "&Browse", null); fWorkingDirBrowseButton = createPushButton(workingDirComp, LaunchUIPlugin.getResourceString("Launch.common.B&rowse..."), null); //$NON-NLS-1$
fWorkingDirBrowseButton.addSelectionListener(new SelectionAdapter() { fWorkingDirBrowseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleWorkingDirBrowseButtonSelected(); handleWorkingDirBrowseButtonSelected();
} }
}); });
fWorkspaceDirButton = createRadioButton(workingDirComp, "Works&pace"); fWorkspaceDirButton = createRadioButton(workingDirComp, LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Works&pace")); //$NON-NLS-1$
fWorkspaceDirButton.addSelectionListener(new SelectionAdapter() { fWorkspaceDirButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleLocationButtonSelected(); handleLocationButtonSelected();
@ -130,7 +130,7 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
} }
}); });
fWorkspaceDirBrowseButton = createPushButton(workingDirComp, "B&rowse...", null); fWorkspaceDirBrowseButton = createPushButton(workingDirComp, LaunchUIPlugin.getResourceString("Launch.common.B&rowse..."), null); //$NON-NLS-1$
fWorkspaceDirBrowseButton.addSelectionListener(new SelectionAdapter() { fWorkspaceDirBrowseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleWorkspaceDirBrowseButtonSelected(); handleWorkspaceDirBrowseButtonSelected();
@ -150,7 +150,7 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
*/ */
protected void handleWorkingDirBrowseButtonSelected() { protected void handleWorkingDirBrowseButtonSelected() {
DirectoryDialog dialog = new DirectoryDialog(getShell()); DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setMessage("Select a &working directory for the launch configuration"); dialog.setMessage(LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Select_&working_directory_for_launch_configuration")); //$NON-NLS-1$
String currentWorkingDir = fWorkingDirText.getText(); String currentWorkingDir = fWorkingDirText.getText();
if (!currentWorkingDir.trim().equals(EMPTY_STRING)) { if (!currentWorkingDir.trim().equals(EMPTY_STRING)) {
File path = new File(currentWorkingDir); File path = new File(currentWorkingDir);
@ -173,7 +173,7 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
ResourcesPlugin.getWorkspace().getRoot(), ResourcesPlugin.getWorkspace().getRoot(),
false, false,
"Select a &workspace relative working directory"); LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Select_&workspace_relative_working_directory")); //$NON-NLS-1$
IContainer currentContainer = getContainer(); IContainer currentContainer = getContainer();
if (currentContainer != null) { if (currentContainer != null) {
@ -263,7 +263,7 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
} }
} }
fWorkingDirText.setText(System.getProperty("user.dir")); fWorkingDirText.setText(System.getProperty("user.dir")); //$NON-NLS-1$
fLocalDirButton.setSelection(true); fLocalDirButton.setSelection(true);
fWorkspaceDirButton.setSelection(false); fWorkspaceDirButton.setSelection(false);
} }
@ -281,17 +281,17 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
if (workingDirPath.length() > 0) { if (workingDirPath.length() > 0) {
File dir = new File(workingDirPath); File dir = new File(workingDirPath);
if (!dir.exists()) { if (!dir.exists()) {
setErrorMessage("Working directory does not exist"); setErrorMessage(LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Working_directory_does_not_exist")); //$NON-NLS-1$
return false; return false;
} }
if (!dir.isDirectory()) { if (!dir.isDirectory()) {
setErrorMessage("Working directory is not a directory_11"); setErrorMessage(LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Working_directory_is_not_a_directory")); //$NON-NLS-1$
return false; return false;
} }
} }
} else { } else {
if (getContainer() == null) { if (getContainer() == null) {
setErrorMessage("Specified project or folder does not exist."); setErrorMessage(LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Project_or_folder_does_not_exist")); //$NON-NLS-1$
return false; return false;
} }
} }
@ -335,7 +335,7 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
} }
handleUseDefaultWorkingDirButtonSelected(); handleUseDefaultWorkingDirButtonSelected();
} catch (CoreException e) { } catch (CoreException e) {
setErrorMessage("Exception occurred reading configuration " + e.getStatus().getMessage()); setErrorMessage(LaunchUIPlugin.getFormattedResourceString("Launch.common.Exception_occurred_reading_configuration_EXCEPTION", e.getStatus().getMessage())); //$NON-NLS-1$
LaunchUIPlugin.log(e); LaunchUIPlugin.log(e);
} }
} }
@ -374,7 +374,7 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
* @see ILaunchConfigurationTab#getName() * @see ILaunchConfigurationTab#getName()
*/ */
public String getName() { public String getName() {
return "Working Directory"; return LaunchUIPlugin.getResourceString("WorkingDirectoryBlock.Working_Directory"); //$NON-NLS-1$
} }
/** /**

View file

@ -24,6 +24,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.help.WorkbenchHelp;
/** /**
* A launch configuration tab that displays and edits program arguments, * A launch configuration tab that displays and edits program arguments,
* and working directory launch configuration attributes. * and working directory launch configuration attributes.
@ -57,7 +58,7 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
createVerticalSpacer(comp, 1); createVerticalSpacer(comp, 1);
fPrgmArgumentsLabel = new Label(comp, SWT.NONE); fPrgmArgumentsLabel = new Label(comp, SWT.NONE);
fPrgmArgumentsLabel.setText("C/C++ Program Arguments:"); fPrgmArgumentsLabel.setText(LaunchUIPlugin.getResourceString("CArgumentsTab.C/C++_Program_Arguments")); //$NON-NLS-1$
fPrgmArgumentsText = new Text(comp, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL); fPrgmArgumentsText = new Text(comp, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
gd = new GridData(GridData.FILL_HORIZONTAL); gd = new GridData(GridData.FILL_HORIZONTAL);
gd.heightHint = 40; gd.heightHint = 40;
@ -105,7 +106,7 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
fWorkingDirectoryBlock.initializeFrom(configuration); fWorkingDirectoryBlock.initializeFrom(configuration);
} }
catch (CoreException e) { catch (CoreException e) {
setErrorMessage("Exception occurred reading configuration " + e.getStatus().getMessage()); setErrorMessage(LaunchUIPlugin.getFormattedResourceString("Launch.common.Exception_occurred_reading_configuration_EXCEPTION", e.getStatus().getMessage())); //$NON-NLS-1$
LaunchUIPlugin.log(e); LaunchUIPlugin.log(e);
} }
} }
@ -137,7 +138,7 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
* @see ILaunchConfigurationTab#getName() * @see ILaunchConfigurationTab#getName()
*/ */
public String getName() { public String getName() {
return "Arguments"; return LaunchUIPlugin.getResourceString("CArgumentsTab.Arguments"); //$NON-NLS-1$
} }
/** /**

View file

@ -13,6 +13,7 @@ import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration; import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab; import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.core.boot.BootLoader; import org.eclipse.core.boot.BootLoader;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
@ -31,6 +32,7 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.help.WorkbenchHelp;
public class CDebuggerTab extends AbstractCDebuggerTab { public class CDebuggerTab extends AbstractCDebuggerTab {
protected Combo fDCombo; protected Combo fDCombo;
@ -56,7 +58,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
layout = new GridLayout(2, false); layout = new GridLayout(2, false);
comboComp.setLayout(layout); comboComp.setLayout(layout);
Label dlabel = new Label(comboComp, SWT.NONE); Label dlabel = new Label(comboComp, SWT.NONE);
dlabel.setText("Debugger:"); dlabel.setText(LaunchUIPlugin.getResourceString("Launch.common.DebuggerColon")); //$NON-NLS-1$
fDCombo = new Combo(comboComp, SWT.DROP_DOWN | SWT.READ_ONLY); fDCombo = new Combo(comboComp, SWT.DROP_DOWN | SWT.READ_ONLY);
fDCombo.addModifyListener(new ModifyListener() { fDCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) { public void modifyText(ModifyEvent e) {
@ -69,7 +71,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
radioLayout.marginHeight = 0; radioLayout.marginHeight = 0;
radioLayout.marginWidth = 0; radioLayout.marginWidth = 0;
radioComp.setLayout(radioLayout); radioComp.setLayout(radioLayout);
fRunButton = createRadioButton(radioComp, "Run program in debugger."); fRunButton = createRadioButton(radioComp, LaunchUIPlugin.getResourceString("CDebuggerTab.Run_program_in_debugger")); //$NON-NLS-1$
fRunButton.addSelectionListener(new SelectionAdapter() { fRunButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
if (fRunButton.getSelection() == true) { if (fRunButton.getSelection() == true) {
@ -80,7 +82,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
} }
}); });
fAttachButton = createRadioButton(radioComp, "Attach to running process."); fAttachButton = createRadioButton(radioComp, LaunchUIPlugin.getResourceString("CDebuggerTab.Attach_to_running_process")); //$NON-NLS-1$
fAttachButton.addSelectionListener(new SelectionAdapter() { fAttachButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
@ -96,7 +98,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
optionComp.setLayoutData(gd); optionComp.setLayoutData(gd);
fStopInMain = new Button(optionComp, SWT.CHECK); fStopInMain = new Button(optionComp, SWT.CHECK);
fStopInMain.setText("Stop at main() on startup."); fStopInMain.setText(LaunchUIPlugin.getResourceString("CDebuggerTab.Stop_at_main_on_startup")); //$NON-NLS-1$
fStopInMain.addSelectionListener(new SelectionAdapter() { fStopInMain.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
@ -104,7 +106,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
}); });
fVarBookKeeping = new Button(optionComp, SWT.CHECK); fVarBookKeeping = new Button(optionComp, SWT.CHECK);
fVarBookKeeping.setText("Automatically track the values of variables."); fVarBookKeeping.setText(LaunchUIPlugin.getResourceString("CDebuggerTab.Automatically_track_values_of_variables")); //$NON-NLS-1$
fVarBookKeeping.addSelectionListener(new SelectionAdapter() { fVarBookKeeping.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
@ -112,7 +114,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
}); });
Group debuggerGroup = new Group(comp, SWT.SHADOW_ETCHED_IN); Group debuggerGroup = new Group(comp, SWT.SHADOW_ETCHED_IN);
debuggerGroup.setText("Debugger Options"); debuggerGroup.setText(LaunchUIPlugin.getResourceString("CDebuggerTab.Debugger_Options")); //$NON-NLS-1$
setDynamicTabHolder(debuggerGroup); setDynamicTabHolder(debuggerGroup);
GridLayout tabHolderLayout = new GridLayout(); GridLayout tabHolderLayout = new GridLayout();
tabHolderLayout.marginHeight = 0; tabHolderLayout.marginHeight = 0;
@ -127,7 +129,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
protected void loadDebuggerComboBox(ILaunchConfiguration config, String selection) { protected void loadDebuggerComboBox(ILaunchConfiguration config, String selection) {
ICDebugConfiguration[] debugConfigs; ICDebugConfiguration[] debugConfigs;
String configPlatform = getPlatform(config); String configPlatform = getPlatform(config);
String programCPU = "native"; String programCPU = ICDebugConfiguration.PLATFORM_NATIVE;
ICElement ce = getContext(config, configPlatform); ICElement ce = getContext(config, configPlatform);
if (ce instanceof IBinary) { if (ce instanceof IBinary) {
IBinary bin = (IBinary) ce; IBinary bin = (IBinary) ce;
@ -150,7 +152,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
String debuggerPlatform = debugConfigs[i].getPlatform(); String debuggerPlatform = debugConfigs[i].getPlatform();
boolean isNative = configPlatform.equals(BootLoader.getOS()); boolean isNative = configPlatform.equals(BootLoader.getOS());
if (debuggerPlatform.equalsIgnoreCase(configPlatform) if (debuggerPlatform.equalsIgnoreCase(configPlatform)
|| (isNative && debuggerPlatform.equalsIgnoreCase("native"))) { || (isNative && debuggerPlatform.equalsIgnoreCase(ICDebugConfiguration.PLATFORM_NATIVE))) {
if (debugConfigs[i].supportsCPU(programCPU)) { if (debugConfigs[i].supportsCPU(programCPU)) {
fDCombo.add(debugConfigs[i].getName()); fDCombo.add(debugConfigs[i].getName());
fDCombo.setData(Integer.toString(x), debugConfigs[i]); fDCombo.setData(Integer.toString(x), debugConfigs[i]);
@ -165,7 +167,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
} }
} }
// if no selection meaning nothing in config the force initdefault on tab // if no selection meaning nothing in config the force initdefault on tab
setInitializeDefault(selection.equals("") ? true : false); setInitializeDefault(selection.equals("") ? true : false); //$NON-NLS-1$
fDCombo.select(selndx == -1 ? 0 : selndx); fDCombo.select(selndx == -1 ? 0 : selndx);
//The behaviour is undefined for if the callbacks should be triggered for this, //The behaviour is undefined for if the callbacks should be triggered for this,
@ -215,7 +217,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
public void initializeFrom(ILaunchConfiguration config) { public void initializeFrom(ILaunchConfiguration config) {
super.initializeFrom(config); super.initializeFrom(config);
try { try {
String id = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, ""); String id = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, ""); //$NON-NLS-1$
if (getDebugConfig() == null || !getDebugConfig().getID().equals(id)) { if (getDebugConfig() == null || !getDebugConfig().getID().equals(id)) {
loadDebuggerComboBox(config, id); loadDebuggerComboBox(config, id);
} }
@ -261,14 +263,14 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
public boolean isValid(ILaunchConfiguration config) { public boolean isValid(ILaunchConfiguration config) {
if (!validateDebuggerConfig(config)) { if (!validateDebuggerConfig(config)) {
setErrorMessage("No debugger available"); setErrorMessage(LaunchUIPlugin.getResourceString("CDebuggerTab.No_debugger_available")); //$NON-NLS-1$
return false; return false;
} }
if (super.isValid(config) == false) { if (super.isValid(config) == false) {
return false; return false;
} }
if (!fRunButton.getSelection() && !fAttachButton.getSelection()) { if (!fRunButton.getSelection() && !fAttachButton.getSelection()) {
setErrorMessage("Select a Debug mode."); setErrorMessage(LaunchUIPlugin.getResourceString("CDebuggerTab.Select_Debug_mode")); //$NON-NLS-1$
return false; return false;
} }
return true; return true;
@ -278,7 +280,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
String platform = getPlatform(config); String platform = getPlatform(config);
ICElement ce = getContext(config, null); ICElement ce = getContext(config, null);
String projectPlatform = getPlatform(config); String projectPlatform = getPlatform(config);
String projectCPU = "native"; String projectCPU = ICDebugConfiguration.PLATFORM_NATIVE;
if (ce != null) { if (ce != null) {
if (ce instanceof IBinary) { if (ce instanceof IBinary) {
IBinary bin = (IBinary) ce; IBinary bin = (IBinary) ce;
@ -291,7 +293,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
} }
String debuggerPlatform = debugConfig.getPlatform(); String debuggerPlatform = debugConfig.getPlatform();
boolean isNative = platform.equals(projectPlatform); boolean isNative = platform.equals(projectPlatform);
if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (isNative && debuggerPlatform.equalsIgnoreCase("native"))) { if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (isNative && debuggerPlatform.equalsIgnoreCase(ICDebugConfiguration.PLATFORM_NATIVE))) {
if (debugConfig.supportsCPU(projectCPU)) { if (debugConfig.supportsCPU(projectCPU)) {
return true; return true;
} }

View file

@ -15,6 +15,7 @@ import java.util.Properties;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.launch.internal.ui.LaunchImages; import org.eclipse.cdt.launch.internal.ui.LaunchImages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
@ -55,6 +56,7 @@ import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.help.WorkbenchHelp;
public class CEnvironmentTab extends CLaunchConfigurationTab { public class CEnvironmentTab extends CLaunchConfigurationTab {
protected Properties fElements; protected Properties fElements;
@ -124,7 +126,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
protected void configureShell(Shell shell) { protected void configureShell(Shell shell) {
super.configureShell(shell); super.configureShell(shell);
String title = (fEdit) ? "Edit Variable" : "New Variable"; String title = (fEdit) ? LaunchUIPlugin.getResourceString("CEnvironmentTab.Edit_Variable") : LaunchUIPlugin.getResourceString("CEnvironmentTab.New_Variable"); //$NON-NLS-1$ //$NON-NLS-2$
shell.setText(title); shell.setText(title);
} }
@ -142,14 +144,14 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50); int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50);
Label label = new Label(composite, SWT.NONE); Label label = new Label(composite, SWT.NONE);
label.setText("Name:"); label.setText(LaunchUIPlugin.getResourceString("CEnvironmentTab.NameColon")); //$NON-NLS-1$
fTextName = new Text(composite, SWT.SINGLE | SWT.BORDER); fTextName = new Text(composite, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData(GridData.FILL_BOTH); GridData gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true; gd.grabExcessHorizontalSpace = true;
gd.widthHint = fieldWidthHint; gd.widthHint = fieldWidthHint;
fTextName.setLayoutData(gd); fTextName.setLayoutData(gd);
label = new Label(composite, SWT.NONE); label = new Label(composite, SWT.NONE);
label.setText("Value:"); label.setText(LaunchUIPlugin.getResourceString("CEnvironmentTab.ValueColon")); //$NON-NLS-1$
fTextValue = new Text(composite, SWT.SINGLE | SWT.BORDER); fTextValue = new Text(composite, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_BOTH); gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true; gd.grabExcessHorizontalSpace = true;
@ -265,11 +267,11 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
table.setLinesVisible(true); table.setLinesVisible(true);
TableColumn column1 = new TableColumn(table, SWT.NULL); TableColumn column1 = new TableColumn(table, SWT.NULL);
column1.setText("Name"); column1.setText(LaunchUIPlugin.getResourceString("CEnvironmentTab.Name")); //$NON-NLS-1$
tableLayout.addColumnData(new ColumnWeightData(30)); tableLayout.addColumnData(new ColumnWeightData(30));
TableColumn column2 = new TableColumn(table, SWT.NULL); TableColumn column2 = new TableColumn(table, SWT.NULL);
column2.setText("Value"); column2.setText(LaunchUIPlugin.getResourceString("CEnvironmentTab.Value")); //$NON-NLS-1$
tableLayout.addColumnData(new ColumnWeightData(30)); tableLayout.addColumnData(new ColumnWeightData(30));
fVariableList.addDoubleClickListener(new IDoubleClickListener() { fVariableList.addDoubleClickListener(new IDoubleClickListener() {
@ -289,7 +291,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
composite.setLayout(new GridLayout(1, true)); composite.setLayout(new GridLayout(1, true));
fBtnNew = new Button(composite, SWT.NONE); fBtnNew = new Button(composite, SWT.NONE);
fBtnNew.setText("New..."); fBtnNew.setText(LaunchUIPlugin.getResourceString("CEnvironmentTab.New...")); //$NON-NLS-1$
fBtnNew.setLayoutData(new GridData(GridData.FILL_BOTH)); fBtnNew.setLayoutData(new GridData(GridData.FILL_BOTH));
fBtnNew.addSelectionListener(new SelectionAdapter() { fBtnNew.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -297,7 +299,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
} }
}); });
fBtnImport = new Button(composite, SWT.NONE); fBtnImport = new Button(composite, SWT.NONE);
fBtnImport.setText("Import..."); fBtnImport.setText(LaunchUIPlugin.getResourceString("CEnvironmentTab.Import...")); //$NON-NLS-1$
fBtnImport.setLayoutData(new GridData(GridData.FILL_BOTH)); fBtnImport.setLayoutData(new GridData(GridData.FILL_BOTH));
fBtnImport.addSelectionListener(new SelectionAdapter() { fBtnImport.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -305,7 +307,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
} }
}); });
fBtnEdit = new Button(composite, SWT.NONE); fBtnEdit = new Button(composite, SWT.NONE);
fBtnEdit.setText("Edit..."); fBtnEdit.setText(LaunchUIPlugin.getResourceString("CEnvironmentTab.Edit...")); //$NON-NLS-1$
fBtnEdit.setLayoutData(new GridData(GridData.FILL_BOTH)); fBtnEdit.setLayoutData(new GridData(GridData.FILL_BOTH));
fBtnEdit.addSelectionListener(new SelectionAdapter() { fBtnEdit.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -313,7 +315,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
} }
}); });
fBtnRemove = new Button(composite, SWT.NONE); fBtnRemove = new Button(composite, SWT.NONE);
fBtnRemove.setText("Remove"); fBtnRemove.setText(LaunchUIPlugin.getResourceString("CEnvironmentTab.Remove")); //$NON-NLS-1$
fBtnRemove.setLayoutData(new GridData(GridData.FILL_BOTH)); fBtnRemove.setLayoutData(new GridData(GridData.FILL_BOTH));
fBtnRemove.addSelectionListener(new SelectionAdapter() { fBtnRemove.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -374,10 +376,10 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
continue; continue;
} }
int demarcation = line.indexOf("="); int demarcation = line.indexOf("="); //$NON-NLS-1$
if(demarcation == -1) { if(demarcation == -1) {
key = line; key = line;
value = ""; value = ""; //$NON-NLS-1$
} else { } else {
key = line.substring(0, demarcation); key = line.substring(0, demarcation);
value = line.substring(demarcation + 1, line.length()); value = line.substring(demarcation + 1, line.length());
@ -385,7 +387,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
if(fElements.getProperty(key) != null) { if(fElements.getProperty(key) != null) {
boolean overwrite; boolean overwrite;
overwrite = MessageDialog.openQuestion(getShell(), "Existing Environment Variable", "Environment variable \"" + key + "\" exists.\nDo you want to overwrite?"); overwrite = MessageDialog.openQuestion(getShell(), LaunchUIPlugin.getResourceString("CEnvironmentTab.Existing_Environment_Variable"), LaunchUIPlugin.getFormattedResourceString("CEnvironmentTab.Environment_variable_NAME_exists", key)); //$NON-NLS-1$ //$NON-NLS-2$
if(!overwrite) { if(!overwrite) {
continue; continue;
} }
@ -454,7 +456,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/ */
public String getName() { public String getName() {
return "Environment"; return LaunchUIPlugin.getResourceString("CEnvironmentTab.Environment"); //$NON-NLS-1$
} }
/** /**

View file

@ -46,7 +46,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
} }
catch (CoreException e) { catch (CoreException e) {
} }
if (projectName != null && !projectName.equals("")) { if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project); ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project);
if (cProject != null && cProject.exists()) { if (cProject != null && cProject.exists()) {
@ -73,12 +73,12 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
obj = ce; obj = ce;
} }
if (obj instanceof ICElement) { if (obj instanceof ICElement) {
if (platform != null && !platform.equals("*")) { if (platform != null && !platform.equals("*")) { //$NON-NLS-1$
ICDescriptor descriptor; ICDescriptor descriptor;
try { try {
descriptor = CCorePlugin.getDefault().getCProjectDescription(((ICElement) obj).getCProject().getProject()); descriptor = CCorePlugin.getDefault().getCProjectDescription(((ICElement) obj).getCProject().getProject());
String projectPlatform = descriptor.getPlatform(); String projectPlatform = descriptor.getPlatform();
if (!projectPlatform.equals(platform) && !projectPlatform.equals("*")) { if (!projectPlatform.equals(platform) && !projectPlatform.equals("*")) { //$NON-NLS-1$
obj = null; obj = null;
} }
} }
@ -86,7 +86,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
} }
} }
if (obj != null) { if (obj != null) {
if (programName == null || programName.equals("")) { if (programName == null || programName.equals("")) { //$NON-NLS-1$
return (ICElement) obj; return (ICElement) obj;
} }
ICElement ce = (ICElement) obj; ICElement ce = (ICElement) obj;

View file

@ -14,6 +14,7 @@ import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.internal.ui.CElementImageProvider; import org.eclipse.cdt.internal.ui.CElementImageProvider;
import org.eclipse.cdt.internal.ui.CPluginImages; import org.eclipse.cdt.internal.ui.CPluginImages;
import org.eclipse.cdt.launch.internal.ui.LaunchImages; import org.eclipse.cdt.launch.internal.ui.LaunchImages;
@ -107,7 +108,7 @@ public class CMainTab extends CLaunchConfigurationTab {
projComp.setLayoutData(gd); projComp.setLayoutData(gd);
fProjLabel = new Label(projComp, SWT.NONE); fProjLabel = new Label(projComp, SWT.NONE);
fProjLabel.setText("&Project:"); fProjLabel.setText(LaunchUIPlugin.getResourceString("CMainTab.&ProjectColon")); //$NON-NLS-1$
gd = new GridData(); gd = new GridData();
gd.horizontalSpan = 2; gd.horizontalSpan = 2;
fProjLabel.setLayoutData(gd); fProjLabel.setLayoutData(gd);
@ -121,7 +122,7 @@ public class CMainTab extends CLaunchConfigurationTab {
} }
}); });
fProjButton = createPushButton(projComp, "&Browse...", null); fProjButton = createPushButton(projComp, LaunchUIPlugin.getResourceString("Launch.common.B&rowse..."), null); //$NON-NLS-1$
fProjButton.addSelectionListener(new SelectionAdapter() { fProjButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleProjectButtonSelected(); handleProjectButtonSelected();
@ -140,7 +141,7 @@ public class CMainTab extends CLaunchConfigurationTab {
gd = new GridData(GridData.FILL_HORIZONTAL); gd = new GridData(GridData.FILL_HORIZONTAL);
mainComp.setLayoutData(gd); mainComp.setLayoutData(gd);
fProgLabel = new Label(mainComp, SWT.NONE); fProgLabel = new Label(mainComp, SWT.NONE);
fProgLabel.setText("C/C++ Application:"); fProgLabel.setText(LaunchUIPlugin.getResourceString("CMainTab.C/C++_Application")); //$NON-NLS-1$
gd = new GridData(); gd = new GridData();
gd.horizontalSpan = 3; gd.horizontalSpan = 3;
fProgLabel.setLayoutData(gd); fProgLabel.setLayoutData(gd);
@ -153,7 +154,7 @@ public class CMainTab extends CLaunchConfigurationTab {
} }
}); });
fSearchButton = createPushButton(mainComp, "Searc&h...", null); fSearchButton = createPushButton(mainComp, LaunchUIPlugin.getResourceString("CMainTab.Search..."), null); //$NON-NLS-1$
fSearchButton.addSelectionListener(new SelectionAdapter() { fSearchButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleSearchButtonSelected(); handleSearchButtonSelected();
@ -162,7 +163,7 @@ public class CMainTab extends CLaunchConfigurationTab {
}); });
Button fBrowseForBinaryButton; Button fBrowseForBinaryButton;
fBrowseForBinaryButton = createPushButton(mainComp, "B&rowse...", null); fBrowseForBinaryButton = createPushButton(mainComp, LaunchUIPlugin.getResourceString("Launch.common.B&rowse..."), null); //$NON-NLS-1$
fBrowseForBinaryButton.addSelectionListener(new SelectionAdapter() { fBrowseForBinaryButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleBinaryBrowseButtonSelected(); handleBinaryBrowseButtonSelected();
@ -219,8 +220,8 @@ public class CMainTab extends CLaunchConfigurationTab {
if (getCProject() == null) { if (getCProject() == null) {
MessageDialog.openInformation( MessageDialog.openInformation(
getShell(), getShell(),
"Project required", LaunchUIPlugin.getResourceString("CMainTab.Project_required"), //$NON-NLS-1$
"Project must first be entered before searching for a program"); LaunchUIPlugin.getResourceString("CMainTab.Enter_project_before_searching_for_program")); //$NON-NLS-1$
return; return;
} }
@ -261,8 +262,8 @@ public class CMainTab extends CLaunchConfigurationTab {
if (element instanceof IBinary) { if (element instanceof IBinary) {
IBinary bin = (IBinary)element; IBinary bin = (IBinary)element;
StringBuffer name = new StringBuffer(); StringBuffer name = new StringBuffer();
name.append(bin.getCPU() + (bin.isLittleEndian() ? "le" : "be")); name.append(bin.getCPU() + (bin.isLittleEndian() ? "le" : "be")); //$NON-NLS-1$ //$NON-NLS-2$
name.append(" - "); name.append(" - "); //$NON-NLS-1$
name.append(bin.getPath().toString()); name.append(bin.getPath().toString());
return name.toString(); return name.toString();
} }
@ -272,10 +273,10 @@ public class CMainTab extends CLaunchConfigurationTab {
TwoPaneElementSelector dialog = new TwoPaneElementSelector(getShell(), programLabelProvider, qualifierLabelProvider); TwoPaneElementSelector dialog = new TwoPaneElementSelector(getShell(), programLabelProvider, qualifierLabelProvider);
dialog.setElements(getBinaryFiles(getCProject())); dialog.setElements(getBinaryFiles(getCProject()));
dialog.setMessage("Choose a &program to run:"); dialog.setMessage(LaunchUIPlugin.getResourceString("CMainTab.Choose_program_to_run")); //$NON-NLS-1$
dialog.setTitle("Program Selection"); dialog.setTitle(LaunchUIPlugin.getResourceString("CMainTab.Program_Selection")); //$NON-NLS-1$
dialog.setUpperListLabel("Binaries:"); dialog.setUpperListLabel(LaunchUIPlugin.getResourceString("Launch.common.BinariesColon")); //$NON-NLS-1$
dialog.setLowerListLabel("Qualifier:"); dialog.setLowerListLabel(LaunchUIPlugin.getResourceString("Launch.common.QualifierColon")); //$NON-NLS-1$
dialog.setMultipleSelection(false); dialog.setMultipleSelection(false);
//dialog.set //dialog.set
if (dialog.open() == ElementListSelectionDialog.OK) { if (dialog.open() == ElementListSelectionDialog.OK) {
@ -296,8 +297,8 @@ public class CMainTab extends CLaunchConfigurationTab {
if(cproject == null) { if(cproject == null) {
MessageDialog.openInformation( MessageDialog.openInformation(
getShell(), getShell(),
"Project required", LaunchUIPlugin.getResourceString("CMainTab.Project_required"), //$NON-NLS-1$
"Project must first be entered before browsing for a program"); LaunchUIPlugin.getResourceString("CMainTab.Enter_project_before_browsing_for_program")); //$NON-NLS-1$
return; return;
} }
@ -305,26 +306,26 @@ public class CMainTab extends CLaunchConfigurationTab {
WorkbenchLabelProvider labelProvider = new WorkbenchLabelProvider(); WorkbenchLabelProvider labelProvider = new WorkbenchLabelProvider();
WorkbenchContentProvider contentProvider = new WorkbenchContentProvider(); WorkbenchContentProvider contentProvider = new WorkbenchContentProvider();
dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, contentProvider); dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, contentProvider);
dialog.setTitle("Program selection"); dialog.setTitle(LaunchUIPlugin.getResourceString("CMainTab.Program_selection")); //$NON-NLS-1$
dialog.setMessage("Choose a program to run from " + cproject.getResource().getName() + ":"); dialog.setMessage(LaunchUIPlugin.getFormattedResourceString("CMainTab.Choose_program_to_run_from_NAME", cproject.getResource().getName())); //$NON-NLS-1$
dialog.setBlockOnOpen(true); dialog.setBlockOnOpen(true);
dialog.setAllowMultiple(false); dialog.setAllowMultiple(false);
dialog.setInput(cproject.getResource()); dialog.setInput(cproject.getResource());
dialog.setValidator(new ISelectionStatusValidator() { dialog.setValidator(new ISelectionStatusValidator() {
public IStatus validate(Object [] selection) { public IStatus validate(Object [] selection) {
if(selection.length == 0 || !(selection[0] instanceof IFile)) { if(selection.length == 0 || !(selection[0] instanceof IFile)) {
return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, "Selection must be a file", null); return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_file"), null); //$NON-NLS-1$
} else { } else {
try { try {
ICElement celement = cproject.findElement(((IFile)selection[0]).getProjectRelativePath()); ICElement celement = cproject.findElement(((IFile)selection[0]).getProjectRelativePath());
if(celement == null || if(celement == null ||
(celement.getElementType() != ICElement.C_BINARY && celement.getElementType() != ICElement.C_ARCHIVE)) { (celement.getElementType() != ICElement.C_BINARY && celement.getElementType() != ICElement.C_ARCHIVE)) {
return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, "Selection must be a binary file", null); return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$
} }
return new Status(IStatus.OK, LaunchUIPlugin.PLUGIN_ID, IStatus.OK, celement.getResource().getName(), null); return new Status(IStatus.OK, LaunchUIPlugin.PLUGIN_ID, IStatus.OK, celement.getResource().getName(), null);
} catch(Exception ex) { } catch(Exception ex) {
return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, "Selection must be a binary file", null); return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$
} }
} }
} }
@ -391,8 +392,8 @@ public class CMainTab extends CLaunchConfigurationTab {
ILabelProvider labelProvider = new CElementLabelProvider(); ILabelProvider labelProvider = new CElementLabelProvider();
ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider); ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
dialog.setTitle("Project Selection"); dialog.setTitle(LaunchUIPlugin.getResourceString("CMainTab.Project_Selection")); //$NON-NLS-1$
dialog.setMessage("Choose a &project to constrain the search for a program"); dialog.setMessage(LaunchUIPlugin.getResourceString("CMainTab.Choose_project_to_constrain_search_for_program")); //$NON-NLS-1$
dialog.setElements(projects); dialog.setElements(projects);
ICProject cProject = getCProject(); ICProject cProject = getCProject();
@ -419,9 +420,9 @@ public class CMainTab extends CLaunchConfigurationTab {
try { try {
cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject) cproject[i].getResource()); cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject) cproject[i].getResource());
String projectPlatform = cdesciptor.getPlatform(); String projectPlatform = cdesciptor.getPlatform();
if (filterPlatform.equals("*") if (filterPlatform.equals("*") //$NON-NLS-1$
|| projectPlatform.equals("*") || projectPlatform.equals("*") //$NON-NLS-1$
|| (isNative && cdesciptor.getPlatform().equalsIgnoreCase("native")) || (isNative && cdesciptor.getPlatform().equalsIgnoreCase(ICDebugConfiguration.PLATFORM_NATIVE))
|| filterPlatform.equalsIgnoreCase(cdesciptor.getPlatform()) == true) { || filterPlatform.equalsIgnoreCase(cdesciptor.getPlatform()) == true) {
list.add(cproject[i]); list.add(cproject[i]);
} }
@ -453,30 +454,30 @@ public class CMainTab extends CLaunchConfigurationTab {
String name = fProjText.getText().trim(); String name = fProjText.getText().trim();
if (name.length() == 0) { if (name.length() == 0) {
setErrorMessage("Project not specified"); setErrorMessage(LaunchUIPlugin.getResourceString("CMainTab.Project_not_specified")); //$NON-NLS-1$
return false; return false;
} }
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) { if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
setErrorMessage("Project does not exist"); setErrorMessage(LaunchUIPlugin.getResourceString("Launch.common.Project_does_not_exist")); //$NON-NLS-1$
return false; return false;
} }
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
name = fProgText.getText().trim(); name = fProgText.getText().trim();
if (name.length() == 0) { if (name.length() == 0) {
setErrorMessage("Program not specified"); setErrorMessage(LaunchUIPlugin.getResourceString("CMainTab.Program_not_specified")); //$NON-NLS-1$
return false; return false;
} }
if (name.equals(".") || name.equals("..")) { if (name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
setErrorMessage("Program does not exist"); setErrorMessage(LaunchUIPlugin.getResourceString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
return false; return false;
} }
if (!project.isOpen()) { if (!project.isOpen()) {
setErrorMessage("Project must be opened"); setErrorMessage(LaunchUIPlugin.getResourceString("CMainTab.Project_must_be_opened")); //$NON-NLS-1$
return false; return false;
} }
if (!project.getFile(name).exists()) { if (!project.getFile(name).exists()) {
setErrorMessage("Program does not exist"); setErrorMessage(LaunchUIPlugin.getResourceString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
return false; return false;
} }
return true; return true;
@ -533,7 +534,7 @@ public class CMainTab extends CLaunchConfigurationTab {
* @see ILaunchConfigurationTab#getName() * @see ILaunchConfigurationTab#getName()
*/ */
public String getName() { public String getName() {
return "Main"; return LaunchUIPlugin.getResourceString("CMainTab.Main"); //$NON-NLS-1$
} }
/** /**

View file

@ -9,6 +9,7 @@ import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.debug.ui.sourcelookup.SourceLookupBlock; import org.eclipse.cdt.debug.ui.sourcelookup.SourceLookupBlock;
import org.eclipse.cdt.launch.internal.ui.LaunchImages; import org.eclipse.cdt.launch.internal.ui.LaunchImages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -77,7 +78,7 @@ public class CSourceLookupTab extends CLaunchConfigurationTab
*/ */
public String getName() public String getName()
{ {
return "Source"; return LaunchUIPlugin.getResourceString("CSourceLookupTab.Source"); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -93,7 +94,7 @@ public class CSourceLookupTab extends CLaunchConfigurationTab
IProject project = null; IProject project = null;
try try
{ {
String projectName = configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "" ); String projectName = configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "" ); //$NON-NLS-1$
if ( !isEmpty( projectName ) ) if ( !isEmpty( projectName ) )
project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName ); project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName );
} }

View file

@ -12,6 +12,7 @@ import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration; import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab; import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
@ -40,7 +41,7 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
GridLayout topLayout = new GridLayout(2, false); GridLayout topLayout = new GridLayout(2, false);
comp.setLayout(topLayout); comp.setLayout(topLayout);
Label dlabel = new Label(comp, SWT.NONE); Label dlabel = new Label(comp, SWT.NONE);
dlabel.setText("Debugger:"); dlabel.setText(LaunchUIPlugin.getResourceString("Launch.common.DebuggerColon")); //$NON-NLS-1$
fDCombo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY); fDCombo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY);
fDCombo.addModifyListener(new ModifyListener() { fDCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) { public void modifyText(ModifyEvent e) {
@ -48,7 +49,7 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
} }
}); });
Group debuggerGroup = new Group(comp, SWT.SHADOW_ETCHED_IN); Group debuggerGroup = new Group(comp, SWT.SHADOW_ETCHED_IN);
debuggerGroup.setText("Debugger Options"); debuggerGroup.setText(LaunchUIPlugin.getResourceString("CorefileDebuggerTab.Debugger_Options")); //$NON-NLS-1$
setDynamicTabHolder(debuggerGroup); setDynamicTabHolder(debuggerGroup);
GridLayout tabHolderLayout = new GridLayout(); GridLayout tabHolderLayout = new GridLayout();
tabHolderLayout.marginHeight = 0; tabHolderLayout.marginHeight = 0;
@ -68,8 +69,8 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
ICDebugConfiguration[] debugConfigs; ICDebugConfiguration[] debugConfigs;
String configPlatform = getPlatform(config); String configPlatform = getPlatform(config);
ICElement ce = getContext(config, null); ICElement ce = getContext(config, null);
String projectPlatform = "*"; String projectPlatform = "*"; //$NON-NLS-1$
String projectCPU = "*"; String projectCPU = "*"; //$NON-NLS-1$
if (ce != null) { if (ce != null) {
try { try {
ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject()); ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject());
@ -87,7 +88,7 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) { if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) {
String debuggerPlatform = debugConfigs[i].getPlatform(); String debuggerPlatform = debugConfigs[i].getPlatform();
boolean platformMatch = configPlatform.equals(projectPlatform); boolean platformMatch = configPlatform.equals(projectPlatform);
if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (platformMatch && projectPlatform.equals("*"))) { if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (platformMatch && projectPlatform.equals("*"))) { //$NON-NLS-1$
if (debugConfigs[i].supportsCPU(projectCPU)) { if (debugConfigs[i].supportsCPU(projectCPU)) {
fDCombo.add(debugConfigs[i].getName()); fDCombo.add(debugConfigs[i].getName());
fDCombo.setData(Integer.toString(x), debugConfigs[i]); fDCombo.setData(Integer.toString(x), debugConfigs[i]);
@ -102,7 +103,7 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
} }
} }
// if no selection meaning nothing in config the force initdefault on tab // if no selection meaning nothing in config the force initdefault on tab
setInitializeDefault(selection.equals("") ? true : false); setInitializeDefault(selection.equals("") ? true : false); //$NON-NLS-1$
fDCombo.select(selndx == -1 ? 0 : selndx); fDCombo.select(selndx == -1 ? 0 : selndx);
//The behaviour is undefined for if the callbacks should be triggered for this, //The behaviour is undefined for if the callbacks should be triggered for this,
@ -115,7 +116,7 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
public void initializeFrom(ILaunchConfiguration config) { public void initializeFrom(ILaunchConfiguration config) {
super.initializeFrom(config); super.initializeFrom(config);
try { try {
String id = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, ""); String id = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, ""); //$NON-NLS-1$
if (getDebugConfig() == null || !getDebugConfig().getID().equals(id)) { if (getDebugConfig() == null || !getDebugConfig().getID().equals(id)) {
loadDebuggerComboBox(config, id); loadDebuggerComboBox(config, id);
} }
@ -133,7 +134,7 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
public boolean isValid(ILaunchConfiguration config) { public boolean isValid(ILaunchConfiguration config) {
if (!validateDebuggerConfig(config)) { if (!validateDebuggerConfig(config)) {
setErrorMessage("No debugger available"); setErrorMessage(LaunchUIPlugin.getResourceString("CorefileDebuggerTab.No_debugger_available")); //$NON-NLS-1$
return false; return false;
} }
return super.isValid(config); return super.isValid(config);
@ -142,8 +143,8 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
private boolean validateDebuggerConfig(ILaunchConfiguration config) { private boolean validateDebuggerConfig(ILaunchConfiguration config) {
String platform = getPlatform(config); String platform = getPlatform(config);
ICElement ce = getContext(config, null); ICElement ce = getContext(config, null);
String projectPlatform = "*"; String projectPlatform = "*"; //$NON-NLS-1$
String projectCPU = "*"; String projectCPU = "*"; //$NON-NLS-1$
if (ce != null) { if (ce != null) {
try { try {
ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject()); ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject());
@ -159,7 +160,7 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
} }
String debuggerPlatform = debugConfig.getPlatform(); String debuggerPlatform = debugConfig.getPlatform();
boolean platformMatch = platform.equals(projectPlatform); boolean platformMatch = platform.equals(projectPlatform);
if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (platformMatch && projectPlatform.equals("*"))) { if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (platformMatch && projectPlatform.equals("*"))) { //$NON-NLS-1$
if (debugConfig.supportsCPU(projectCPU)) { if (debugConfig.supportsCPU(projectCPU)) {
return true; return true;
} }