Skip to content

Commit

Permalink
[eclipse] Do not show hidden folders in explorer.
Browse files Browse the repository at this point in the history
close #629

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Mar 31, 2017
1 parent 2e9c812 commit 63f60e3
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -23,7 +23,7 @@

import java.io.File;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
Expand All @@ -41,12 +41,12 @@ public class HiddenFileFilter extends ViewerFilter {

@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof IFile) {
final IFile file = (IFile) element;
if (file.isHidden() || file.isDerived()) {
if (element instanceof IResource) {
final IResource resource = (IResource) element;
if (resource.isHidden() || resource.isDerived() || resource.isPhantom()) {
return false;
}
final IPath path2 = file.getFullPath();
final IPath path2 = resource.getRawLocation();
if (path2 != null) {
final File rawFile = path2.toFile();
return rawFile != null && !rawFile.isHidden();
Expand Down

0 comments on commit 63f60e3

Please sign in to comment.