Bug 537525 - Follow up of Bug 312397 - Run Configuration Command Line to
Clipboard

Change-Id: If197112aa3f36344e0efc5d77be169ae743d9e27
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 de89a84..2fd2bd8 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
@@ -117,7 +117,7 @@
 LaunchConfigurationsDialog_Information_3=Information
 LaunchConfigurationDialog_ShowCommandLine=Sho&w Command Line
 LaunchConfigurationDialog_ShowCommandLine_Title=Command Line
-LaunchConfigurationDialog_ShowCommandLine_Copy=C&opy
+LaunchConfigurationDialog_ShowCommandLine_Copy=C&opy && Close
 LaunchConfigurationDialog_ShowCommandLine_Default=Command Line could not be retrieved.
 LaunchConfigurationsDialog_0=New launch configuration
 LaunchConfigurationsDialog_1=Delete selected launch configuration(s)
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 e333b90..6a4f541 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
@@ -23,6 +23,7 @@
 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2;
 import org.eclipse.debug.internal.core.DebugCoreMessages;
+import org.eclipse.debug.internal.core.LaunchManager;
 import org.eclipse.debug.internal.ui.DebugUIPlugin;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -75,6 +76,10 @@
 		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
 	}
 
+	private LaunchManager getLaunchManager() {
+		return (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
+	}
+
 	@Override
 	protected Control createDialogArea(Composite parent) {
 		Composite comp = (Composite) super.createDialogArea(parent);
@@ -121,6 +126,8 @@
 							throw new CoreException(status);
 						}
 					}
+					launch.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING,
+							getLaunchManager().getEncoding(flaunchConfiguration));
 				}
 				command = delegate.showCommandLine(flaunchConfiguration, fMode, launch,
 						null);