1 /*******************************************************************************
2 * Copyright (c) 2000, 2008 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
9 * IBM Corporation - initial API and implementation
10 * Anton Leherbauer (Wind River Systems)
11 *******************************************************************************/
12 package org.eclipse.cdt.internal.ui.filters;
15 import org.eclipse.core.resources.IProject;
16 import org.eclipse.jface.viewers.Viewer;
17 import org.eclipse.jface.viewers.ViewerFilter;
19 import org.eclipse.cdt.core.model.CoreModel;
20 import org.eclipse.cdt.core.model.ICProject;
24 * Filters (open) non-C projects.
26 public class NonCProjectsFilter extends ViewerFilter {
32 public boolean select(Viewer viewer, Object parent, Object element) {
33 if (element instanceof ICProject) {
35 } else if (element instanceof IProject) {
36 IProject project = (IProject)element;
37 if (!project.isOpen()) {
40 if (CoreModel.hasCNature(project)) {