Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhauge2010-06-28 20:30:47 +0000
committernhauge2010-06-28 20:30:47 +0000
commit6016ae3f65d723a773bb4b6fc164d32ab3a41c02 (patch)
tree7b1b33d20c195a495686860557efc075529e7071
parentaf3c3beee163f650ade1b2292afc9959134b8aec (diff)
downloadwebtools.dali-6016ae3f65d723a773bb4b6fc164d32ab3a41c02.tar.gz
webtools.dali-6016ae3f65d723a773bb4b6fc164d32ab3a41c02.tar.xz
webtools.dali-6016ae3f65d723a773bb4b6fc164d32ab3a41c02.zip
312506 - filter out package-info.java from contents.
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java
index 89858f243c..0c1a6949bd 100644
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java
+++ b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java
@@ -22,16 +22,20 @@ import org.eclipse.jdt.core.IJavaElement;
/**
- * Filters out all non-Java elements.
+ * Filters out all non-Java elements, and elements named package-info
*/
public class NonJavaElementFilter extends ViewerFilter {
+ static public String FILE_TO_EXCLUDE = "package-info.java"; //$NON-NLS-1$
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IJavaElement)
- return true;
+ if (element instanceof IJavaElement) {
+ return(FILE_TO_EXCLUDE.equals(((IJavaElement)element).getElementName())) ?
+ false : true;
+ }
if (element instanceof IResource) {
IProject project= ((IResource)element).getProject();

Back to the top