01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.enhydra.kelp.eclipse.ui.launcher;
11:
12: import java.util.HashSet;
13: import java.util.Set;
14: import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
15: import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
16: import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
17: import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
18: import org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer;
19: import org.eclipse.jdt.launching.sourcelookup.containers.*;
20:
21: /**
22: * Java source lookup director.
23: *
24: * @since 3.0
25: */
26: public class JavaSourceLookupDirector extends
27: AbstractSourceLookupDirector {
28:
29: private static Set fFilteredTypes;
30:
31: static {
32: fFilteredTypes = new HashSet();
33: fFilteredTypes.add(ProjectSourceContainer.TYPE_ID);
34: fFilteredTypes.add(WorkspaceSourceContainer.TYPE_ID);
35: // can't reference UI constant
36: fFilteredTypes
37: .add("org.eclipse.debug.ui.containerType.workingSet"); //$NON-NLS-1$
38: }
39:
40: /* (non-Javadoc)
41: * @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector#initializeParticipants()
42: */
43: public void initializeParticipants() {
44: addParticipants(new ISourceLookupParticipant[] { new JavaSourceLookupParticipant() });
45: }
46:
47: /* (non-Javadoc)
48: * @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector#supportsSourceContainerType(org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType)
49: */
50: public boolean supportsSourceContainerType(ISourceContainerType type) {
51: return !fFilteredTypes.contains(type.getId());
52: }
53: }
|