Author: tfennelly
Date: 2009-12-02 17:51:13 -0500 (Wed, 02 Dec 2009)
New Revision: 19011
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5312
Smooks Run Configuration - needs unique name to avoid collisions
Updated to use ILaunchManager.generateUniqueLaunchConfigurationNameFrom
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-12-02
22:27:59 UTC (rev 19010)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-12-02
22:51:13 UTC (rev 19011)
@@ -58,6 +58,7 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
@@ -184,8 +185,9 @@
if(editorInput instanceof FileEditorInput) {
FileEditorInput fileEI = (FileEditorInput) editorInput;
IFile file = fileEI.getFile();
+ String configName =
getLaunchManager().generateUniqueLaunchConfigurationNameFrom(editor.getTitle());
- launchConfigWC.rename("[" + file.getProject().getName() + "]" +
editor.getTitle());
+ launchConfigWC.rename(configName);
launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
file.getProject().getName()); //$NON-NLS-1$
launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
file.getProjectRelativePath().toString()); //$NON-NLS-1$
}