Added
Link Here
|
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2007 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.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, Object element) { |
28 |
IProject project = null; |
29 |
|
30 |
if (element instanceof IJavaProject) { |
31 |
project = ((IJavaProject) element).getProject(); |
32 |
} else if (element instanceof IProject) { |
33 |
project = (IProject) element; |
34 |
} |
35 |
if (project != null) { |
36 |
String projectName = project.getName(); |
37 |
if (projectName.equals(SearchablePluginsManager.PROXY_PROJECT_NAME)) { |
38 |
return false; |
39 |
} |
40 |
} |
41 |
return true; |
42 |
} |
43 |
|
44 |
} |