Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 99062 Details for
Bug 219335
[filters] replace implicit rule for empty classpath containers with filter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
219335.patch (text/plain), 6.82 KB, created by
Martin Aeschlimann
on 2008-05-07 08:54:54 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Martin Aeschlimann
Created:
2008-05-07 08:54:54 EDT
Size:
6.82 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/viewsupport/ProblemTreeViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/ProblemTreeViewer.java,v >retrieving revision 1.49 >diff -u -r1.49 ProblemTreeViewer.java >--- ui/org/eclipse/jdt/internal/ui/viewsupport/ProblemTreeViewer.java 29 May 2007 18:41:49 -0000 1.49 >+++ ui/org/eclipse/jdt/internal/ui/viewsupport/ProblemTreeViewer.java 7 May 2008 12:53:37 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 IBM Corporation and others. > * 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 >@@ -246,7 +246,12 @@ > return super.isExpandable(parent); > } > >- protected final boolean hasFilteredChildren(Object parent) { >+ /** >+ * Public method to test if a element has any children that passed the filters >+ * @param parent the element to test >+ * @return return <code>true</code> if the element has at least a child that passed the filters >+ */ >+ public final boolean hasFilteredChildren(Object parent) { > Object[] rawChildren= getRawChildren(parent); > return containsNonFiltered(rawChildren, parent); > } >@@ -323,7 +328,7 @@ > * Public method to test if a element is filtered by the views active filters > * @param object the element to test for > * @param parent the parent element >- * @return return <code>true if the element is filtered</code> >+ * @return return <code>true</code> if the element is filtered > */ > public boolean isFiltered(Object object, Object parent) { > return isFiltered(object, parent, getFilters()); >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/plugin.xml,v >retrieving revision 1.807 >diff -u -r1.807 plugin.xml >--- plugin.xml 15 Apr 2008 08:31:55 -0000 1.807 >+++ plugin.xml 7 May 2008 12:53:37 -0000 >@@ -4710,12 +4710,20 @@ > </filter> > <filter > targetId="org.eclipse.jdt.ui.PackageExplorer" >+ name="%HideEmptyLibraryContainers.label" >+ enabled="true" >+ description="%HideEmptyLibraryContainers.description" >+ class="org.eclipse.jdt.internal.ui.filters.EmptyLibraryContainerFilter" >+ id="org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter"> >+ </filter> >+ <filter >+ targetId="org.eclipse.jdt.ui.PackageExplorer" > name="%HideReferencedLibraries.label" > enabled="false" > description="%HideReferencedLibraries.description" > class="org.eclipse.jdt.internal.ui.filters.LibraryFilter" > id="org.eclipse.jdt.ui.PackageExplorer.LibraryFilter"> >- </filter> >+ </filter> > <filter > targetId="org.eclipse.jdt.ui.PackageExplorer" > name="%HideContainedLibraries.label" >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/plugin.properties,v >retrieving revision 1.508 >diff -u -r1.508 plugin.properties >--- plugin.properties 15 Apr 2008 08:31:55 -0000 1.508 >+++ plugin.properties 7 May 2008 12:53:35 -0000 >@@ -502,6 +502,9 @@ > HideNonJavaElements.label= Non-Java elements > HideNonJavaElements.description= Hides all non-Java elements > >+HideEmptyLibraryContainers.label= Empty library containers >+HideEmptyLibraryContainers.description= Hides library containers which do not contain at least one library that is not filtered >+ > HideReferencedLibraries.label= Libraries from external > HideReferencedLibraries.description= Hides external libraries i.e. those not contained inside the project itself > >Index: ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java,v >retrieving revision 1.315 >diff -u -r1.315 PackageExplorerPart.java >--- ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java 7 May 2008 10:47:24 -0000 1.315 >+++ ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java 7 May 2008 12:53:37 -0000 >@@ -277,10 +277,6 @@ > } > > protected boolean isFiltered(Object object, Object parent, ViewerFilter[] filters) { >- if (object instanceof PackageFragmentRootContainer) { >- return !hasFilteredChildren(object); >- } >- > boolean res= super.isFiltered(object, parent, filters); > if (res && isEssential(object)) { > return false; >Index: ui/org/eclipse/jdt/internal/ui/filters/EmptyLibraryContainerFilter.java >=================================================================== >RCS file: ui/org/eclipse/jdt/internal/ui/filters/EmptyLibraryContainerFilter.java >diff -N ui/org/eclipse/jdt/internal/ui/filters/EmptyLibraryContainerFilter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/internal/ui/filters/EmptyLibraryContainerFilter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,35 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation and others. >+ * 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: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.internal.ui.filters; >+ >+import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.jface.viewers.ViewerFilter; >+ >+import org.eclipse.jdt.internal.ui.packageview.PackageFragmentRootContainer; >+import org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer; >+ >+/** >+ * The library container filter is a filter used to determine whether >+ * library containers are shown that are empty or have all children filtered out by other filters. >+ * The filter is only applicable on a {@link ProblemTreeViewer} >+ */ >+public class EmptyLibraryContainerFilter extends ViewerFilter { >+ >+ /* (non-Javadoc) >+ * Method declared on ViewerFilter. >+ */ >+ public boolean select(Viewer viewer, Object parentElement, Object element) { >+ if (element instanceof PackageFragmentRootContainer && viewer instanceof ProblemTreeViewer) { >+ return ((ProblemTreeViewer) viewer).hasFilteredChildren(element); >+ } >+ return true; >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 219335
: 99062 |
99074