01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 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: * Peter Friese <peter.friese@gentleware.com> - bug 194694
11: *******************************************************************************/package org.eclipse.pde.internal.ui.wizards.imports;
12:
13: import org.eclipse.core.resources.IProject;
14: import org.eclipse.jdt.core.IJavaProject;
15: import org.eclipse.jface.viewers.Viewer;
16: import org.eclipse.jface.viewers.ViewerFilter;
17: import org.eclipse.pde.internal.core.SearchablePluginsManager;
18:
19: public class ExternalPluginLibrariesFilter extends ViewerFilter {
20:
21: /**
22: * Returns <code>false</code> if the given element is the External Plugin Libraries project,
23: * and <code>true</code> otherwise.
24: *
25: * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
26: */
27: public boolean select(Viewer viewer, Object parentElement,
28: Object element) {
29: IProject project = null;
30:
31: if (element instanceof IJavaProject) {
32: project = ((IJavaProject) element).getProject();
33: } else if (element instanceof IProject) {
34: project = (IProject) element;
35: }
36: if (project != null) {
37: String projectName = project.getName();
38: if (projectName
39: .equals(SearchablePluginsManager.PROXY_PROJECT_NAME)) {
40: return false;
41: }
42: }
43: return true;
44: }
45:
46: }
|