Importing the XDebugProxy code in the HEAD. The repo was tagged with T_BEFORE_XDEBUGP...
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / php / launching / PHPSourceLookupDirector.java
1 package net.sourceforge.phpeclipse.xdebug.php.launching;
2
3
4 import java.util.List;
5 import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
6 import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
7
8 public class PHPSourceLookupDirector extends AbstractSourceLookupDirector {
9
10         public void initializeParticipants() {
11                 setFindDuplicates(true);
12                 addParticipants(new ISourceLookupParticipant[] {new PHPSourceLookupParticipant()});
13         }
14         
15         public Object getSourceElement(Object element) {
16                 List sources = doSourceLookup(element);
17                 if(sources.size() == 1) {
18                         return sources.get(0);
19                 } else if(sources.size() > 1) {
20                         return resolveSourceElement(element, sources);
21                 } else { 
22                         return null;
23                 }
24         }
25 }