sschmeck
sschmeck

Reputation: 7685

Using eclipse resource filters

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:

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

Answers (3)

GauravKadyan
GauravKadyan

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

  • Exclude all
  • then Applies to - Folders
  • then check - All children(recursive)
  • then under FilterDetails choose "Project Rleate Path" and "matches" and check "Regular Expression"
  • Now for the case where you want to only include directory java under src, you should use the expression: 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

Vrushank
Vrushank

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:

  • Click on the down arrow located at the top-right
  • Click Select Working Set
  • Click New to create your 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

user1182253
user1182253

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

Related Questions