3

How can I open all source code files in a eclipse project at once? It takes too long to open all files in large projects by expanding out the packages and clicking on all the files.

I would like to know how to do this so I can ctrl+e to classes quickly.

user2097804
  • 1,122
  • 4
  • 13
  • 22

1 Answers1

7

It is not a good way to keep open all source files in a project because a project may have hundreds of source files. There is NO direct way to open all source files in eclipse.

However you can do it in two ways:

Using open resource dialog:

  • Create a working set which includes your project. Refer this.

  • Press Ctrl+Shift+R and select the your working set(Click on the downward pointed triangle button)

  • Type *.java in the text box. Dialog will list all java files in your project. Press Ctrl+A to select all files. Click on open button.

Using search dialog:

  • Select your project in Package explorer/Navigator/Projects view.

  • Press Ctrl+H. Go to File search tab. Leave "Containing text:" as blank. In File name patterns text box enter *.java. In scope section choose Selected resource option. Press search button. All source files will be displayed in search view.

  • Change the view layout of Search view to Show as list(In search view toolbar click on the downward pointed triangle button)

  • Press Ctrl+A to select all results. Right click and select open option.

Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68
  • Why is it a bad idea to open all source files, even if there are hundreds? Is the performance really slow or something? – user2097804 Sep 15 '14 at 19:57
  • Yes.I personally not prefer this.Assume you opened 50 files, even after maximizing the editor area you can see only 8 file tabs are visible rest are hidden under **>>42** indicator.Again either you have to click on this button to navigate to other files or use short cut to cycle through open editors.Instead of that you can simply use open type short cut(Ctrl+Shift+T) which is very handy and remembers your search history also.Workbench has to remember all the opened editors so it add to performance.[Mylyn](http://www.eclipse.org/mylyn)plugin shows the resource which relevant to current context – Chandrayya G K Sep 16 '14 at 07:06