Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Eclipse Project Explorer Filters

DZone's Guide to

Eclipse Project Explorer Filters

· Java Zone
Free Resource

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

Wondering why the Eclipse Project view might not show all files in the Project Explorer view? For example it shows this:

Eclipse Project Explorer View

Eclipse Project Explorer View

But on disk I have more files? Where are they?

:idea: I’m using Eclipse Luna (4.4) in this post, but things are very similar for earlier versions of Eclipse.

File System has more Files?

Checking the files on my file system (e.g. with the Windows Explorer), I have more files/folders listed:

Files on the File System

Files on the File System

Obviously, files and folders starting with a dot (‘.’) are not shown in the Project Explorer view.

Project View Filters

The reason is that the Eclipse Project Explorer view has a filter built-in to hide files. There is a setting for this in the View Menu of that view:

Project Explorer View Menu

Project Explorer View Menu

There is a ‘Customize View…‘ menu item:

Customize Project Explorer View

Customize Project Explorer View

And here I have the filters:

Customize Project Explorer View

Customize Project Explorer View

Now it should be clear why the files starting with a dot are ont shown: they are filtered out with the filter for “.*”:

Project Explorer View Filters

Project Explorer View Filters

Un-checking that filter will show now as well the dot files:

Showing Dot Files in Project Explorer View

Showing Dot Files in Project Explorer View

Defining my own Filters

The list of filters in the project view is provided by the plugins. And unfortunately there is no way to define my own filters in the above dialog, unless I would implement my Java plugin. Defining my own filters without programming things is possible, it is just in a different place:-).

For example I do not want to see that ‘ProjectInfo.xml’. For this, I select the project and use the ‘Properties’ menu. Inside the project properties, there is Resource > Resource Filters:

Resource Filters

Resource Filters

Use the Add button to add a new filter:

Adding Filter

Adding Filter

To exclude just the ProjectInfo.xml:

  1. Exclude all (this will exclude all files matching my filter)
  2. Applies to Files (I only want to have it applied to files)
  3. [Name] [matches] the file name
Excluding Files

Excluding Files

With that, I can build any kind of filters.

Pressing OK, and it gets added to my filter list:

Added Filter

Added Filter

Now the ProjectInfo.xml is not listed any more in the Project Explorer view:

Filtered ProjectView.xml

Filtered ProjectView.xml

Summary

The Eclipse Project Explorer view has a setting to turn on/off filters for files/folders, or in general to configure the view. I can use project resource filters to define my own filters too.

Happy Filtering :-)

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}