c8c9759975d1f6c44f37cb77bfba30008f84b6f6
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / resourcesview / PHPViewerFilter.java
1 package net.sourceforge.phpeclipse.resourcesview;
2
3 import org.eclipse.core.resources.IFolder;
4 import org.eclipse.core.runtime.IAdaptable;
5 import org.eclipse.jface.viewers.Viewer;
6 import org.eclipse.jface.viewers.ViewerFilter;
7
8 public class PHPViewerFilter extends ViewerFilter {
9
10         public PHPViewerFilter() {
11                 super();
12         }
13
14         public boolean select(Viewer viewer, Object parentElement, Object element) {
15                 if (element instanceof IFolder)
16                         return true;
17
18                 IAdaptable adaptable = (IAdaptable) element;
19                 PHPElement phpElement = (PHPElement) adaptable.getAdapter(PHPElement.class);
20                 if (phpElement != null)
21                         return true;
22
23                 return false;
24         }
25 }