diff options
Diffstat (limited to 'org.eclipse.debug.ui/ui/org')
7 files changed, 118 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties index 36560a0b0..bc4f5a944 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties @@ -9,10 +9,13 @@ # IBM Corporation - initial API and implementation ############################################################################### +DebugUIPlugin.23=Build in Progress +DebugUIPlugin.24=Wait for build to finish? +DebugUIPlugin.25=Build in Progress +DebugUIPlugin.26=Wait for build to finish? DebugUIPlugin.Build_error._Check_log_for_details._2=Build error. Check log for details. DebugUIPlugin.Run/Debug_1=Run/Debug -DebugUITools.4=Build in Progress -DebugUITools.5=Wait for build to finish? + DebugUITools.6=Launch waiting for completion of: DebugUITools.7={0} waiting for completion of {1} DebugUITools.8=Launching diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java index db6aa89a0..e7b11539a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java @@ -347,6 +347,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener { prefs.setDefault(IDebugUIConstants.PREF_REUSE_EDITOR, true); prefs.setDefault(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE, false); prefs.setDefault(IDebugUIConstants.PREF_RELAUNCH_IN_DEBUG_MODE, AlwaysNeverDialog.PROMPT); + prefs.setDefault(IDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR, AlwaysNeverDialog.PROMPT); //ConsolePreferencePage prefs.setDefault(IDebugPreferenceConstants.CONSOLE_WRAP, false); @@ -777,9 +778,9 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener { if (builds.length > 0) { String waitForBuild = store.getString(IDebugUIConstants.PREF_WAIT_FOR_BUILD); - + if (waitForBuild.equals(AlwaysNeverDialog.PROMPT)) { - PromptDialog prompt = new PromptDialog(getShell(), DebugUIMessages.getString("DebugUITools.4"), DebugUIMessages.getString("DebugUITools.5"), IDebugUIConstants.PREF_WAIT_FOR_BUILD, store); + PromptDialog prompt = new PromptDialog(getShell(), DebugUIMessages.getString("DebugUIPlugin.23"), DebugUIMessages.getString("DebugUIPlugin.24"), IDebugUIConstants.PREF_WAIT_FOR_BUILD, store); //$NON-NLS-1$ //$NON-NLS-2$ prompt.open(); switch (prompt.getReturnCode()) { @@ -888,7 +889,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener { if (builds.length > 0) { // if there are build jobs running, do we wait or not?? if (waitForBuild.equals(AlwaysNeverDialog.PROMPT)) { boolean wait = false; - PromptDialog prompt = new PromptDialog(getShell(), DebugUIMessages.getString("DebugUITools.4"), DebugUIMessages.getString("DebugUITools.5"), IDebugUIConstants.PREF_WAIT_FOR_BUILD, store); + PromptDialog prompt = new PromptDialog(getShell(), DebugUIMessages.getString("DebugUIPlugin.25"), DebugUIMessages.getString("DebugUIPlugin.26"), IDebugUIConstants.PREF_WAIT_FOR_BUILD, store); //$NON-NLS-1$ //$NON-NLS-2$ prompt.open(); switch (prompt.getReturnCode()) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java new file mode 100644 index 000000000..b75b7f239 --- /dev/null +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.internal.ui.launchConfigurations; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.debug.core.IStatusHandler; +import org.eclipse.debug.internal.ui.AlwaysNeverDialog; +import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.swt.widgets.Shell; + + +public class CompileErrorPromptStatusHandler implements IStatusHandler { + + /* (non-Javadoc) + * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object) + */ + public Object handleStatus(IStatus status, Object source) throws CoreException { + Shell shell = DebugUIPlugin.getShell(); + String title = LaunchConfigurationsMessages.getString("CompileErrorPromptStatusHandler.0"); //$NON-NLS-1$ + String message = LaunchConfigurationsMessages.getString("CompileErrorPromptStatusHandler.1"); //$NON-NLS-1$ + IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); + + String pref = store.getString(IDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR); + if (pref != null) { + if (pref.equals(AlwaysNeverDialog.ALWAYS)) { + return new Boolean(true); + } + } + + PromptDialog pd = new PromptDialog(shell, title, message, IDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR, store); + pd.open(); + + int returnValue = pd.getReturnCode(); + if (returnValue == 0 || returnValue == 2) { //YES=0, ALWAYS=2 + return new Boolean(true); + } else { // ESC=-1, NO=1 + return new Boolean(false); + } + + } + + + private class PromptDialog extends MessageDialog { + + private String fPreferenceKey = null; + private String fResult = null; + private IPreferenceStore fStore = null; + + public PromptDialog(Shell parent, String title, String message, String preferenceKey, IPreferenceStore store) { + super(parent, title, null, message, QUESTION, new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, LaunchConfigurationsMessages.getString("CompileErrorPromptStatusHandler.2")},0); // yes is the default //$NON-NLS-1$ + fStore = store; + fPreferenceKey = preferenceKey; + } + + protected void buttonPressed(int id) { + if (id == 2) { // Always + fResult= AlwaysNeverDialog.ALWAYS; + } else { + fResult= AlwaysNeverDialog.PROMPT; + } + + if (fStore != null && fPreferenceKey != null) { + fStore.setValue(fPreferenceKey, fResult); + } + + super.buttonPressed(id); + } + } + + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties index b2cb577a6..9eea9d02d 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties @@ -20,6 +20,9 @@ CommonTab.Select_a_location_for_the_launch_configuration_13=Select a location fo CommonTab.Type_of_launch_configuration__2=Type of launch configuration: CommonTab.Cannot_save_launch_configuration_in_a_closed_project._1=Cannot save launch configuration in a closed project. CommonTab.10=Launch in bac&kground +CompileErrorPromptStatusHandler.0=Compile Errors in Project +CompileErrorPromptStatusHandler.1=Compile errors exist in your project or one of its prerequisite projects.\nContinue Launch? +CompileErrorPromptStatusHandler.2=Always LaunchConfigurationDialog.&Apply_17=Appl&y LaunchConfigurationDialog.&Name__16=&Name: diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties index 1c17a816b..2141bff36 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties @@ -35,6 +35,9 @@ DebugPreferencePage.26=A&ctivate the debug view when a breakpoint is hit LaunchingPreferencePage.1=&Build (if required) before launching LaunchingPreferencePage.2=Save dirty editors before launching +LaunchingPreferencePage.21=Continue Launch if Project Contains Compile Errors +LaunchingPreferencePage.22=Always +LaunchingPreferencePage.23=Prompt LaunchingPreferencePage.3=Alwa&ys LaunchingPreferencePage.4=&Never LaunchingPreferencePage.5=&Prompt diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java index 5ffc1ec53..c105e28ea 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java @@ -57,10 +57,12 @@ public class LaunchingPreferencePage extends FieldEditorPreferencePage implement addField(new BooleanFieldEditor(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, DebugPreferencesMessages.getString("LaunchingPreferencePage.10"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$ createSwitchPerspectiveEditor(); createRelaunchInDebugMode(); + createContinueWithCompileErrors(); createLaunchHistoryEditor(); } + protected void createSpacer(Composite composite, int columnSpan) { Label label = new Label(composite, SWT.NONE); GridData gd = new GridData(); @@ -122,7 +124,16 @@ public class LaunchingPreferencePage extends FieldEditorPreferencePage implement getFieldEditorParent(), true)); } - + + private void createContinueWithCompileErrors() { + addField(new RadioGroupFieldEditor(IDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR, + DebugPreferencesMessages.getString("LaunchingPreferencePage.21"), 2, //$NON-NLS-1$ + new String[][] {{DebugPreferencesMessages.getString("LaunchingPreferencePage.22"), AlwaysNeverDialog.ALWAYS}, //$NON-NLS-1$ + {DebugPreferencesMessages.getString("LaunchingPreferencePage.23"), AlwaysNeverDialog.PROMPT}}, //$NON-NLS-1$ + getFieldEditorParent(), + true)); + } + /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java index 43d49ef58..ab9e81bec 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java @@ -165,7 +165,13 @@ public interface IDebugUIConstants { * @since 3.0 */ public static final String PREF_RELAUNCH_IN_DEBUG_MODE = PLUGIN_ID + ".relaunch_in_debug_mode"; //$NON-NLS-1$ - + + /** + * Preference specifying that launches should continue when compile errors exist. + * @since 3.0 + */ + public static final String PREF_CONTINUE_WITH_COMPILE_ERROR = PLUGIN_ID + ".cancel_launch_with_compile_errors"; //$NON-NLS-1$ + /** * Boolean preference controlling whether the debugger re-uses non-dirty editors * that it opens when displaying source. When <code>true</code> the debugger |