Lines 10-16
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.wst.jsdt.debug.internal.core.breakpoints; |
11 |
package org.eclipse.wst.jsdt.debug.internal.core.breakpoints; |
12 |
|
12 |
|
13 |
import java.net.URI; |
|
|
14 |
import java.net.URISyntaxException; |
13 |
import java.net.URISyntaxException; |
15 |
import java.util.ArrayList; |
14 |
import java.util.ArrayList; |
16 |
import java.util.HashMap; |
15 |
import java.util.HashMap; |
Lines 20-26
Link Here
|
20 |
|
19 |
|
21 |
import org.eclipse.core.resources.IMarker; |
20 |
import org.eclipse.core.resources.IMarker; |
22 |
import org.eclipse.core.resources.IWorkspace; |
21 |
import org.eclipse.core.resources.IWorkspace; |
23 |
import org.eclipse.core.resources.IWorkspaceRoot; |
|
|
24 |
import org.eclipse.core.resources.IWorkspaceRunnable; |
22 |
import org.eclipse.core.resources.IWorkspaceRunnable; |
25 |
import org.eclipse.core.resources.ResourcesPlugin; |
23 |
import org.eclipse.core.resources.ResourcesPlugin; |
26 |
import org.eclipse.core.runtime.CoreException; |
24 |
import org.eclipse.core.runtime.CoreException; |
Lines 43-49
Link Here
|
43 |
import org.eclipse.wst.jsdt.debug.core.model.JavaScriptDebugModel; |
41 |
import org.eclipse.wst.jsdt.debug.core.model.JavaScriptDebugModel; |
44 |
import org.eclipse.wst.jsdt.debug.internal.core.Constants; |
42 |
import org.eclipse.wst.jsdt.debug.internal.core.Constants; |
45 |
import org.eclipse.wst.jsdt.debug.internal.core.JavaScriptDebugPlugin; |
43 |
import org.eclipse.wst.jsdt.debug.internal.core.JavaScriptDebugPlugin; |
46 |
import org.eclipse.wst.jsdt.debug.internal.core.Messages; |
|
|
47 |
import org.eclipse.wst.jsdt.debug.internal.core.launching.SourceLookup; |
44 |
import org.eclipse.wst.jsdt.debug.internal.core.launching.SourceLookup; |
48 |
import org.eclipse.wst.jsdt.debug.internal.core.model.IJavaScriptEventListener; |
45 |
import org.eclipse.wst.jsdt.debug.internal.core.model.IJavaScriptEventListener; |
49 |
import org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget; |
46 |
import org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget; |
Lines 61-67
Link Here
|
61 |
* The total count of all of the targets this breakpoint is installed in |
58 |
* The total count of all of the targets this breakpoint is installed in |
62 |
*/ |
59 |
*/ |
63 |
public static final String INSTALL_COUNT = JavaScriptDebugPlugin.PLUGIN_ID + ".install_count"; //$NON-NLS-1$ |
60 |
public static final String INSTALL_COUNT = JavaScriptDebugPlugin.PLUGIN_ID + ".install_count"; //$NON-NLS-1$ |
64 |
|
61 |
|
65 |
private HashSet targets = null; |
62 |
private HashSet targets = null; |
66 |
private HashMap requestspertarget = new HashMap(4); |
63 |
private HashMap requestspertarget = new HashMap(4); |
67 |
|
64 |
|
Lines 165-172
Link Here
|
165 |
boolean success = true; |
162 |
boolean success = true; |
166 |
for (Iterator iter = scripts.iterator(); iter.hasNext();) { |
163 |
for (Iterator iter = scripts.iterator(); iter.hasNext();) { |
167 |
ScriptReference script = (ScriptReference) iter.next(); |
164 |
ScriptReference script = (ScriptReference) iter.next(); |
168 |
if (scriptPathMatches(script)) |
165 |
if (JavaScriptDebugPlugin.getResolutionManager().matches(script, new Path(getScriptPath()))) { |
169 |
success &= createRequest(target, script); |
166 |
success &= createRequest(target, script); |
|
|
167 |
} |
170 |
} |
168 |
} |
171 |
if (success) { |
169 |
if (success) { |
172 |
if (this.targets == null) { |
170 |
if (this.targets == null) { |
Lines 437-444
Link Here
|
437 |
ScriptReference script = sevent.script(); |
435 |
ScriptReference script = sevent.script(); |
438 |
|
436 |
|
439 |
try { |
437 |
try { |
440 |
if (scriptPathMatches(script)) |
438 |
if (JavaScriptDebugPlugin.getResolutionManager().matches(script, new Path(getScriptPath()))) { |
441 |
createRequest(target, script); |
439 |
createRequest(target, script); |
|
|
440 |
} |
442 |
} catch (CoreException ce) { |
441 |
} catch (CoreException ce) { |
443 |
JavaScriptDebugPlugin.log(ce); |
442 |
JavaScriptDebugPlugin.log(ce); |
444 |
} |
443 |
} |
Lines 446-471
Link Here
|
446 |
return true; |
445 |
return true; |
447 |
} |
446 |
} |
448 |
|
447 |
|
449 |
protected boolean scriptPathMatches(ScriptReference script) throws CoreException { |
|
|
450 |
URI sourceURI = script.sourceURI(); |
451 |
if ("file".equals(sourceURI.getScheme())) {//$NON-NLS-1$ |
452 |
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); |
453 |
URI workspaceURI = workspaceRoot.getRawLocationURI(); |
454 |
sourceURI = workspaceURI.relativize(sourceURI); |
455 |
} |
456 |
String path = getScriptPath(); |
457 |
IPath spath = new Path(path); |
458 |
if(spath.segment(0).equals(Messages.external_javascript_source)) { |
459 |
spath = spath.removeFirstSegments(1).makeAbsolute(); |
460 |
} |
461 |
//XXX use the same algorithm we use to save the source to 'encode' the source URI for comparison |
462 |
IPath uripath = SourceLookup.getSourcePath(sourceURI); |
463 |
if(uripath != null) { |
464 |
uripath = uripath.makeAbsolute(); |
465 |
} |
466 |
return spath.equals(uripath); |
467 |
} |
468 |
|
469 |
/** |
448 |
/** |
470 |
* Returns if the type names for the breakpoint are equal or not. Two <code>null</code> type names are considered to be equal. |
449 |
* Returns if the type names for the breakpoint are equal or not. Two <code>null</code> type names are considered to be equal. |
471 |
* |
450 |
* |