|
From: <caw...@us...> - 2007-09-10 20:33:55
|
Revision: 3125
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3125&view=rev
Author: cawilliams
Date: 2007-09-10 13:29:19 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
add ability to set breakpoints on external libraries (like Rails). Still need to show external filename for breakpoint in listing, and show icon in ruler for external ruby script editor.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/debug/core/RubyLineBreakpoint.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/debug/core/RubyLineBreakpoint.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/debug/core/RubyLineBreakpoint.java 2007-09-10 18:40:55 UTC (rev 3124)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/debug/core/RubyLineBreakpoint.java 2007-09-10 20:29:19 UTC (rev 3125)
@@ -14,18 +14,24 @@
public class RubyLineBreakpoint extends LineBreakpoint {
public static final String RUBY_BREAKPOINT_MARKER = "org.rubypeople.rdt.debug.core.rubyLineBreakpointMarker"; //$NON-NLS-1$
+ private static final String EXTERNAL_FILENAME = "externalFileName";
private int index = -1 ; // index of breakpoint on ruby debugger side
public RubyLineBreakpoint() {
}
public RubyLineBreakpoint(final IResource resource, final int lineNumber) throws CoreException {
+ this(resource, lineNumber, resource.getName());
+ }
+
+ public RubyLineBreakpoint(final IResource resource, final int lineNumber, final String fileName) throws CoreException {
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
setMarker(resource.createMarker(RUBY_BREAKPOINT_MARKER));
getMarker().setAttribute(IMarker.LINE_NUMBER, lineNumber + 1);
getMarker().setAttribute(IBreakpoint.ID, getModelIdentifier());
getMarker().setAttribute(REGISTERED, false);
+ getMarker().setAttribute(EXTERNAL_FILENAME, fileName);
// setEnabled must be set before calling setRegistered
setEnabled(true);
setRegistered(true);
@@ -40,7 +46,11 @@
}
public String getFileName() throws CoreException {
- return ensureMarker().getResource().getName();
+ IResource resource = ensureMarker().getResource();
+ if (resource.equals(ResourcesPlugin.getWorkspace().getRoot())) {
+ return ensureMarker().getAttribute(EXTERNAL_FILENAME, "");
+ }
+ return resource.getName();
}
public int getLineNumber() throws CoreException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|