|
From: <caw...@us...> - 2007-09-17 20:05:10
|
Revision: 3196
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3196&view=rev
Author: cawilliams
Date: 2007-09-17 13:04:14 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
fix broken test
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java 2007-09-17 18:16:03 UTC (rev 3195)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java 2007-09-17 20:04:14 UTC (rev 3196)
@@ -132,41 +132,57 @@
}
public boolean isValid(ILaunchConfiguration launchConfig) {
- String projectName = projectSelector.getSelectionText();
- if (projectName.length() == 0) {
- setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidProjectSelectionMessage);
- return false;
- }
+ try {
+ String projectName = launchConfig.getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
+ if (projectName.length() == 0) {
+ setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidProjectSelectionMessage);
+ return false;
+ }
- String fileName = fileSelector.getSelectionText();
- if (fileName.length() == 0) {
- setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidFileSelectionMessage);
- return false;
- }
- File test = new File(fileName);
- if (!test.exists()) {
- try {
- String workingDirectory = launchConfig.getAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
- if (workingDirectory != null && !workingDirectory.trim().equals("")) {
- String blah = workingDirectory + fileName;
- test = new File(blah);
- }
- } catch (CoreException e) {
- RdtDebugUiPlugin.log(e);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (project == null) {
+ setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidProjectSelectionMessage);
+ return false;
}
+ if (!project.exists()) {
+ setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidProjectSelectionMessage);
+ return false;
+ }
+
+ String fileName = launchConfig.getAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, "");
+ if (fileName.length() == 0) {
+ setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidFileSelectionMessage);
+ return false;
+ }
+ File test = new File(fileName);
if (!test.exists()) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if (project != null) {
- test = project.getLocation().append(fileName).toFile();
+ try {
+ String workingDirectory = launchConfig.getAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
+ if (workingDirectory != null && !workingDirectory.trim().equals("")) {
+ String blah = workingDirectory + fileName;
+ test = new File(blah);
+ }
+ } catch (CoreException e) {
+ RdtDebugUiPlugin.log(e);
}
+ if (!test.exists()) {
+ if (project != null) {
+ test = project.getLocation().append(fileName).toFile();
+ }
+ }
+ if (!test.exists()) {
+ setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidFileSelectionMessage);
+ return false;
+ }
}
- if (!test.exists()) {
- return false;
- }
+
+ setErrorMessage(null);
+ return true;
+ } catch (CoreException e) {
+ setErrorMessage(e.getMessage());
+ RdtDebugUiPlugin.log(e);
}
-
- setErrorMessage(null);
- return true;
+ return false;
}
protected void log(Throwable t) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|