Reputation: 7685
I'm using Eclipse to manage few Java files inside a huge project. I want filter all unnecessary files ( project folder -> properties -> resource -> resource filters ) to optimize my setting (Eclipse hangs often).
I need just two folders ( and the subfolders ) at the project root:
src/java
test/java
I tried it with Include Only and Name, Location, Project Relative Path that should matches e.g. src/java/*
, but there was no way to get only these two folders as resources.
Upvotes: 4
Views: 7869
Reputation: 51
Trying to include only the required directory doesn't seem to work at nested level. What works is to exclude everything else other than required directory.
So in Edit Resource Filter Dialog choose
src/(?!java).*
So now everything except the directory java under src should be gone.
If you need more than one directory under src then you could try with '|' in the expression field.
Upvotes: 1
Reputation: 2813
Resource Filters will filter the artifacts during your build. But if you want only specific files or folders that are part of your project, then you need to create a Working Set. What's more handy is that you can even choose to build only these set of files instead of the whole project thereby reducing build time by re-compiling only the modified files.
Refer Eclipse Working Sets Explained on how to create and build working sets.
NOTE: You may use Resource when selecting the type.
Update:
To CREATE a working set:
To MANAGE / EDIT a working set: Use the Edit.. button instead of the New button as mentioned above
To SELECT / BUILD a working set: Use the corresponding option in the Project menu
Hope this helps...
Upvotes: 2
Reputation: 1119
Go to Project Explorer View > Click on View Menu (Will be on the top- something like a down arrow ) > Customize View . It will show filter, in that you choose to hide all the non-java elements etc.
Upvotes: 0