Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2018-08-14 13:34:11 +0000
committerSarika Sinha2018-08-14 13:34:11 +0000
commitbb6e6c7b711a11d6d56af8a1b309f77a1f4a2901 (patch)
tree2824e1b84bf4ed2e905c5b4e11fc4af16a4e03db
parent697ccec4bd0017586f9221ba90c3017f09804a29 (diff)
downloadeclipse.platform.debug-bb6e6c7b711a11d6d56af8a1b309f77a1f4a2901.tar.gz
eclipse.platform.debug-bb6e6c7b711a11d6d56af8a1b309f77a1f4a2901.tar.xz
eclipse.platform.debug-bb6e6c7b711a11d6d56af8a1b309f77a1f4a2901.zip
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ShowCommandLineDialog.java3
4 files changed, 57 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index 3c8104b38..4a2c5008d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -47,6 +47,7 @@ import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.JFaceResources;
@@ -1554,9 +1555,48 @@ public class LaunchConfigurationTabGroupViewer {
* Dialog to Show the Command line
*/
protected void handleShowCommandLinePressed() {
- ShowCommandLineDialog dialog = new ShowCommandLineDialog(getShell(), getLaunchConfigurationDialog().getMode(),
- fOriginal);
- dialog.open();
+ boolean showCommandLineDialog = true;
+ if (isDirty()) {
+ int returnVal = showSaveChangesDialog();
+ if (returnVal == IDialogConstants.YES_ID) {
+ handleApplyPressed();
+ } else if (returnVal == IDialogConstants.NO_ID) {
+ handleRevertPressed();
+ } else {
+ showCommandLineDialog = false;
+ }
+ }
+ if (showCommandLineDialog) {
+ ShowCommandLineDialog dialog = new ShowCommandLineDialog(getShell(),
+ getLaunchConfigurationDialog().getMode(),
+ fWorkingCopy);
+ dialog.open();
+ }
+ }
+
+ private int showSaveChangesDialog() {
+ String message = MessageFormat.format(
+ LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Question,
+ new Object[] { getWorkingCopy().getName() });
+ MessageDialog dialog = new MessageDialog(getShell(),
+ LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Title, null,
+ message,
+ MessageDialog.QUESTION,
+ new String[] {
+ LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Apply,
+ LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Revert,
+ LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Cancel },
+ 0);
+ int ret = dialog.open();
+ int val = IDialogConstants.CANCEL_ID;
+ if (ret == 0 || ret == 1) {
+ if (ret == 0) {
+ val = IDialogConstants.YES_ID;
+ } else {
+ val = IDialogConstants.NO_ID;
+ }
+ }
+ return val;
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
index edaf3c963..cdab75d93 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
@@ -107,7 +107,13 @@ public class LaunchConfigurationsMessages extends NLS {
public static String LaunchConfigurationDialog_ShowCommandLine;
public static String LaunchConfigurationDialog_ShowCommandLine_Title;
public static String LaunchConfigurationDialog_ShowCommandLine_Copy;
+ public static String LaunchConfigurationDialog_ShowCommandLine_Close;
public static String LaunchConfigurationDialog_ShowCommandLine_Default;
+ public static String LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Title;
+ public static String LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Question;
+ public static String LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Apply;
+ public static String LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Revert;
+ public static String LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Cancel;
public static String LaunchConfigurationSelectionDialog_0;
public static String LaunchConfigurationSelectionDialog_1;
public static String LaunchConfigurationSelectionDialog_deleteButtonLabel;
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 2fd2bd86e..4315df280 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
@@ -118,7 +118,13 @@ LaunchConfigurationsDialog_Information_3=Information
LaunchConfigurationDialog_ShowCommandLine=Sho&w Command Line
LaunchConfigurationDialog_ShowCommandLine_Title=Command Line
LaunchConfigurationDialog_ShowCommandLine_Copy=C&opy && Close
+LaunchConfigurationDialog_ShowCommandLine_Close=&Close
LaunchConfigurationDialog_ShowCommandLine_Default=Command Line could not be retrieved.
+LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Title=Apply Changes
+LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Question=The configuration "{0}" has unsaved changes. Do you wish to apply the changes before showing command line?
+LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Apply=&Apply
+LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Revert=&Revert
+LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Cancel=&Close
LaunchConfigurationsDialog_0=New launch configuration
LaunchConfigurationsDialog_1=Delete selected launch configuration(s)
LaunchConfigurationsDialog_2=New launch configuration prototype
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ShowCommandLineDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ShowCommandLineDialog.java
index 6a4f541c4..542eae5a0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ShowCommandLineDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ShowCommandLineDialog.java
@@ -73,7 +73,8 @@ public class ShowCommandLineDialog extends Dialog {
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.OK_ID,
LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Copy, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+ createButton(parent, IDialogConstants.CANCEL_ID,
+ LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Close, false);
}
private LaunchManager getLaunchManager() {

Back to the top