KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > launching > JavaSourceLookupDirector


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.launching;
12
13 import java.util.HashSet JavaDoc;
14 import java.util.Set JavaDoc;
15 import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
16 import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
17 import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
18 import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
19 import org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer;
20 import org.eclipse.jdt.launching.sourcelookup.containers.*;
21
22 /**
23  * Java source lookup director.
24  *
25  * @since 3.0
26  */

27 public class JavaSourceLookupDirector extends AbstractSourceLookupDirector {
28     
29     private static Set JavaDoc fFilteredTypes;
30     
31     static {
32         fFilteredTypes = new HashSet JavaDoc();
33         fFilteredTypes.add(ProjectSourceContainer.TYPE_ID);
34         fFilteredTypes.add(WorkspaceSourceContainer.TYPE_ID);
35         // can't reference UI constant
36
fFilteredTypes.add("org.eclipse.debug.ui.containerType.workingSet"); //$NON-NLS-1$
37
}
38     
39     /* (non-Javadoc)
40      * @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector#initializeParticipants()
41      */

42     public void initializeParticipants() {
43         addParticipants(new ISourceLookupParticipant[] {new JavaSourceLookupParticipant()});
44     }
45     /* (non-Javadoc)
46      * @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector#supportsSourceContainerType(org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType)
47      */

48     public boolean supportsSourceContainerType(ISourceContainerType type) {
49         return !fFilteredTypes.contains(type.getId());
50     }
51 }
52
Popular Tags