Skip to main content
summaryrefslogtreecommitdiffstats
blob: 9ae95f8b9bc5dcc188e8aec508b0a2126785922f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*******************************************************************************
* Copyright (c) 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
* 
* Contributors:
*     Oracle - initial API and implementation
*     
*     Code originate from XXXX
*******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.filters;

import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

/**
 *  NonArchiveOrExternalElementFilter
 */
public class NonArchiveOrExternalElementFilter extends ViewerFilter {

	@Override
	public boolean select(Viewer viewer, Object parent, Object element) {
		if(element instanceof IPackageFragmentRoot) {
			IPackageFragmentRoot root= (IPackageFragmentRoot) element;
			return !root.isArchive() && !root.isExternal();
		}
		return true;
	}

	@Override
	public String toString() {
		return "Filter out: Non-Archive and Non-External"; //$NON-NLS-1$
	}

}

Back to the top