Author: simoneg
Date: Mon Oct  5 22:32:00 2009
New Revision: 822059

URL: http://svn.apache.org/viewvc?rev=822059&view=rev
Log:
LABS-474 : check for right run configuration

Modified:
    
labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java

Modified: 
labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java
URL: 
http://svn.apache.org/viewvc/labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java?rev=822059&r1=822058&r2=822059&view=diff
==============================================================================
--- 
labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java
 (original)
+++ 
labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java
 Mon Oct  5 22:32:00 2009
@@ -26,6 +26,7 @@
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.wst.common.internal.emf.resource.RootTranslator;
 import org.maven.ide.eclipse.actions.MavenLaunchConstants;
 
 public class MagmaLaunchShortcut implements ILaunchShortcut2,
@@ -122,7 +123,7 @@
                try {
                        ILaunchConfigurationType configType = 
getConfigurationType();
                        String goals = this.goalName == null ? "magma:run" : 
this.goalName;
-                       String basename = prj.getName() + " - " + goals;
+                       String basename = prj.getName() + " - " + 
goals.replace(':', '-');
                        ILaunchConfigurationWorkingCopy wc = 
configType.newInstance(null,
                                        
DebugPlugin.getDefault().getLaunchManager()
                                                        
.generateUniqueLaunchConfigurationNameFrom(
@@ -147,6 +148,7 @@
                        ILaunchConfiguration[] configs = 
DebugPlugin.getDefault()
                                        
.getLaunchManager().getLaunchConfigurations(configType);
                        candidateConfigs = new ArrayList(configs.length);
+                       String mygoals = this.goalName == null ? "magma:run" : 
this.goalName;
                        for (int i = 0; i < configs.length; i++) {
                                ILaunchConfiguration config = configs[i];
                                String pomDir = config.getAttribute(
@@ -157,8 +159,8 @@
                                                
.getStringVariableManager().performStringSubstitution(
                                                                pomDir);
                                File accpd = new File(pomDir);
-                               if 
(accpd.getAbsolutePath().startsWith(root.getAbsolutePath())) {
-                                       if (this.goalName == null || 
goals.indexOf(" " + this.goalName + " ") > -1) {
+                               if (accpd.equals(root)) {
+                                       if (mygoals == null || goals.indexOf(" 
" + mygoals + " ") > -1) {
                                                candidateConfigs.add(config);
                                        }
                                }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to