01: package org.drools.eclipse.launching;
02:
03: import org.drools.eclipse.DRLInfo.FunctionInfo;
04: import org.drools.eclipse.DRLInfo.RuleInfo;
05: import org.drools.eclipse.debug.core.DroolsStackFrame;
06: import org.eclipse.core.runtime.CoreException;
07: import org.eclipse.jdt.launching.sourcelookup.containers.JavaSourceLookupParticipant;
08:
09: public class DroolsSourceLookupParticipant extends
10: JavaSourceLookupParticipant {
11:
12: public String getSourceName(Object object) throws CoreException {
13: if (object instanceof DroolsStackFrame) {
14: RuleInfo ruleInfo = ((DroolsStackFrame) object)
15: .getExecutingRuleInfo();
16: if (ruleInfo != null) {
17: String p = ruleInfo.getSourcePathName();
18: return p;
19: }
20: FunctionInfo functionInfo = ((DroolsStackFrame) object)
21: .getExecutingFunctionInfo();
22: if (functionInfo != null) {
23: return functionInfo.getSourcePathName();
24: }
25: }
26: return super.getSourceName(object);
27: }
28:
29: }
|