eclipse 在包资源管理器视图中过滤空目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4630996/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Filter Empty Directories in Package Explorer View
提问by Matt
Is there a way in eclipse to filter/hide empty directory trees in the package explorer view?
eclipse 中有没有办法在包资源管理器视图中过滤/隐藏空目录树?
This is different than filtering directories like '.svn' or maven's target, or filtering empty packages. It's more trying to clean up empty directories trees that show up as a result of filter rules.
这与过滤诸如“.svn”或 maven 的目标之类的目录或过滤空包不同。更多的是试图清理由于过滤规则而出现的空目录树。
Context- We have a generic project in our workspace that uses filters to ignore non text based files(mp3s, jpgs, etc). It allows us to quickly edit our files in eclipse. The problem is because of the filters there are a lot of empty folders present. If eclipse can ignore any empty folders due to filters it would make the project cleaner.
上下文 - 我们的工作区中有一个通用项目,它使用过滤器来忽略非基于文本的文件(mp3、jpg 等)。它允许我们在 eclipse 中快速编辑我们的文件。问题是由于过滤器存在很多空文件夹。如果 Eclipse 由于过滤器而可以忽略任何空文件夹,它会使项目更干净。
Update- I filed a bug report in eclipse's buzilla system for those that wish to have this feature: https://bugs.eclipse.org/bugs/show_bug.cgi?id=334052
更新 - 我在 eclipse 的 buzilla 系统中为那些希望拥有此功能的人提交了错误报告:https://bugs.eclipse.org/bugs/show_bug.cgi?id=334052
回答by Someone Somewhere
In Eclipse SDK (I use 3.6.2), to hide empty folders in the "Package Explorer":
在 Eclipse SDK(我使用 3.6.2)中,在“包资源管理器”中隐藏空文件夹:
At the top-right of the Package Explorer view, there's a downward-pointing triangle. If you hover your mouse pointer over it you'll see "View Menu".
在 Package Explorer 视图的右上角,有一个向下的三角形。如果您将鼠标指针悬停在它上面,您将看到“查看菜单”。
- Click the "View Menu"
- Selected "Filters"
- Put a check next to "Empty Packages"
- Click OK
- 点击“查看菜单”
- 选择的“过滤器”
- 在“空包裹”旁边打勾
- 单击确定
now your empty folders don't show any more.
现在您的空文件夹不再显示。
回答by VonC
This doesn't seem to be possible and could make for a good bug report.
这似乎是不可能的,并且可以生成一个很好的错误报告。
As bug 157336(build output contains unnecessary empty directories) comments:
"
foo/bar/
" is treated as "foo/bar/**
".
So, as I understand itfoo/bar/**
should exclude the content of the directory andfoo/bar
should additionally exclude the directory itself.
“
foo/bar/
”被视为“foo/bar/**
”。
所以,据我所知,它foo/bar/**
应该排除目录的内容,并且还foo/bar
应该排除目录本身。
Meaning you might have to add every empty directory yourself to the Exclude list, which is not practical.
这意味着您可能必须自己将每个空目录添加到排除列表中,这是不切实际的。
Another solution would be to give Mylyna try and see if its task contextswitching could hide any folder you don't need in the current task for you.