One of the key difference between editors and view is that editors are resource based i.e. they work on underlying resources in workspace. For ex: XML editor requires ".xml" file in workspace. Whereas, views may not be resource based. They can be used to show any kind of information. It is also important that we can make views which may display information irrespective of resources opened up in editor window (that's why I said its not always true that view plays role of assistant window around editor area).
In this chapter, we will create Property File Manager View so that it does something useful and more meaningful rather then just displaying static data.
Property File Manager View will search the entire workspace for all the projects. In each project it will search for "Property Files" folder, In each such folder it will look out for all the files with ".properties" extension and display it to the user. This way we will end up with a view as shown in the figure below. Please note that a property file gets displayed in the Property File Manager view only when it is created inside Property Files folder.
Click finish to generate the Property Manager View class.
What follows is the complete listing of Property Manager View class. However, before we move ahead to show this listing we will need to add two dependencies (if not already added) in the plug-in manifest editor.
First dependency (org.eclipse.core.resources) is required since property manager needs to access workspace resources.
Second dependency (org.eclipse.ui.ide) is required since we will open up associated editor whenever user clicks on listed property files in property manager view.
Once the dependencies have been added following code listing will compile successfully.
173.                                 IFile ifile = ResourcesPlugin.getWorkspace().getRoot().