|
From: <caw...@us...> - 2007-07-30 13:18:52
|
Revision: 2900
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2900&view=rev
Author: cawilliams
Date: 2007-07-30 06:18:48 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
fix #5384 - Launch configurations don't allow external files as targets, even though infrastructure is fine for it
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-07-30 13:18:40 UTC (rev 2899)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEntryPointTab.java 2007-07-30 13:18:48 UTC (rev 2900)
@@ -1,6 +1,7 @@
package org.rubypeople.rdt.internal.debug.ui.launcher;
-import org.eclipse.core.resources.IFile;
+import java.io.File;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -21,14 +22,14 @@
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
-import org.rubypeople.rdt.internal.ui.util.RubyFileSelector;
+import org.rubypeople.rdt.internal.ui.util.FileSelector;
import org.rubypeople.rdt.internal.ui.util.RubyProjectSelector;
import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
public class RubyEntryPointTab extends AbstractLaunchConfigurationTab {
protected String originalFileName, originalProjectName;
protected RubyProjectSelector projectSelector;
- protected RubyFileSelector fileSelector;
+ protected FileSelector fileSelector;
public RubyEntryPointTab() {
super();
@@ -48,7 +49,7 @@
});
new Label(composite, SWT.NONE).setText(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_fileLabel);
- fileSelector = new RubyFileSelector(composite, projectSelector);
+ fileSelector = new FileSelector(composite);
fileSelector.setBrowseDialogMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_fileSelectorMessage);
fileSelector.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fileSelector.addModifyListener(new ModifyListener() {
@@ -89,8 +90,8 @@
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectSelector.getSelectionText());
- IFile file = fileSelector.getSelection();
- configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, file == null ? "" : file.getProjectRelativePath().toString());
+ File file = fileSelector.getSelection();
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, file == null ? "" : file.getAbsolutePath());
}
protected Composite createPageRoot(Composite parent) {
@@ -108,21 +109,16 @@
}
public boolean isValid(ILaunchConfiguration launchConfig) {
- try {
-
- String projectName = launchConfig.getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
- if (projectName.length() == 0) {
- setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidProjectSelectionMessage);
- return false;
- }
+ String projectName = projectSelector.getSelectionText();
+ if (projectName.length() == 0) {
+ 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;
- }
- } catch (CoreException e) {
- log(e);
+ String fileName = fileSelector.getSelectionText();
+ if (fileName.length() == 0) {
+ setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyEntryPoint_invalidFileSelectionMessage);
+ return false;
}
setErrorMessage(null);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|