score:0

I'll try answering from the perspective as a plugin developer. From the API:

A working set is intended to group elements for presentation to the user or for operations on a set of elements.

This can be any kind of element and does not have to be a project. Working sets are provided by plugins, which can decide what kind of elements can be added and which provide wizards for adding elements as well as operations that can be performed.

It doesn't really matter for a project in which working set(s) it is in. A Java project is still a Java project if it in a resource working set. It only affects some views, dialogs and operations that filter for certain types of working sets.

Besides Java and Resource working sets, there are also Breakpoint, Task, Plugin and C/C++ working sets (depending on your Eclipse setup of course). Some views only show certain types of working sets while other views don't seem to filter them. For example the "Open Type" and "Open Resource" dialogs seem to display all types of working sets. The "Open task" dialog only shows task working sets.

So what is the actual difference between Java and Resource working sets? I haven't seen any functional differences yet. All standard views and dialogs either seem to handle both or none of these two working set types. Most plugins don't seem to care about the distinction at all - but that doesn't mean some plugin could handle both types differently.

On the other hand resource working sets seem to be a catch-all for any type of project, so it makes sense that most plugins don't make a distinction here. For example if I were to create a plugin that provides an option to analyze Java projects, I would add that operation to the context menu of Java working sets but certainly not to C/C++ working sets. But some people might use resource working sets because they have both Java and C projects in the same working set. So I have to add the Java-specific operation to the context menu of resource working sets too.

score:4

One difference between the working sets is that they provide different editing wizards (as stated here: http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fcworkset.htm). If you edit a resource working set and a java working set respectively you will see they use different screens for selecting which resources/projects are included.

Apart from this I haven't found any other difference. It also does not seem to differ which resources you can choose in any way. So to answer your question which one would be recommended I would answer "it doesn't matter" since they behave the same way.

score:4

A working set is a subset of your workspace and is a way to organise all your projects. With the different types of working sets you have also different types of editing wizards as described here.

Editing wizards

For java projects the Java working set is a more comfortable way to work. Let's assume you have a bunch of java projects in a java working set and you have just opend the editing wizard of the Java Working set:

First of all you can see everything what is in the working set at the moment in the right table. If you now want to include another project you can simply select the project(s) and press CTRL+a. To remove a project you can press CTRL+r

In the Properties of a Resources Working set you don't know what is in the working set until you have scrolled to the bottom of the tree view. This is impossible for people who have 300+ projects in their workspace.

Structure

A benefit from having two types of working sets is structure. There are situations in a daily workflow where it is useful to have different types of working sets, because they have different icons. If you have resources like config files you can create a Resource working set namend 'config files' and put all the files in there.

Afterwards you can open your File Search and search in your config files. This is possible because you can define a working set as a scope for a search.

enter image description here

There are several parts in Eclipse where you can select your working set with the Select working set dialog.

score:10

A working set in the context of eclipse is a logical grouping of related projects to ease search and organize views within the IDE.

A resource working set can capture all types of resources - maybe java source, html, xml, javascript, images - anything that exists within the scope of the projects included into the working set.

The Java working set is a different working set (it is NOT a subset of a resource working set!) which captures only those java files which belong to a source folder and are being compiled into the classpath, or those java files which belong to a module (library) in the build path. Hence, it lets you lookup java "classes" which are in the classpath. Note that all java file in your project may not necessarily be built into the classpath (for example when you exclude a java source file, it does not get built any more). But a java source file which is not included in your classpath can still be detected by a resource working set (you will notice that the icon for an included java source file is a solid J, while for an excluded java source, it is a hollow J).

Example: Say you have two projects p1 and p2 of which p1 belongs to the working set but p2 does not. So:

MyClass.java (belongs to p1 and included in build path) - Shows up in java type search (Ctrl + T) and also in resource search (Ctrl + R).

MyOtherClass.java (belongs to p2 and included in build path) - Does not show up in java type search nor in resource search.

MyExcludedClass.java (belongs to p1 and excluded from build path) - Does not show up in java type search but shows up in resource search.

MyExcludedClass.class (belongs to a dependency jar in the build path of p1) - Shows up in java type search but does not show up in resource search.

MyWebPage.html (belongs to p1) - Does not show up in java working set but in resource working set.

MyOtherWebPage.html (belongs to p2) - Does not show up in java type search nor in resource search.

MyConfig.xml (belongs to p1) - Does not show up in java type search but shows up in resource search.

So, in the context of a Java developer's use: I use Java working sets to look up types / classes defined in Java, whereas the resources working set to lookup all different types.

score:12

It sounds like this should have answered the question:

A Working Set is a subset of your Eclipse projects. You can create different Working Sets and then select which Working Set to display in the Navigator view.

Specifically:

  1. "Working set" (in this particular context), is an "Eclipse thing"

  2. The purpose of Eclipse working sets is to help organize your projects

  3. A project consists of "stuff": source code, bitmap graphics files, WSDL's, CSS style sheets - just about anything imagineable.

  4. Consequently, Eclipse projects are organized (glancing at my J2EE perspective, for example) into subsections like "src", "WebContent", "Services" and so on. A project itself can be one of many different types: a "Java project", a "Java Swing Design project", and "Dynamic Web Project" and so on.

  5. Similarly, an Eclipse Working set can be one of several different types: a "Java working set", a "Breakpoint working set ... and a "Resource working set".

  6. As with Eclipse "Views" and Perspectives", you can usually access any project resource you need any time you need it. Selecting one or another perspective simply makes the object (e.g. "Problems pane" or "Build list") easier to get to.

  7. Which kind of "Working Set" you choose - or whether or not you use working sets at all - is largely just a matter of personal preference and convenience.

Please let us know if you still have any further questions.

PS: Additional links:

https://www.ibm.com/developerworks/library/os-eclipse-visualstudio/

As mentioned, many developers load all their projects into a single Eclipse workspace. It's convenient, but it can sometimes create too much clutter. In addition to closing unnecessary projects, you can define working sets: groups of elements (projects, folders, classes, etc.). Eclipse can use working sets in different views (such as Package Explorer) and operations (like searching).

...and:

help.eclipse.org: Working Sets


Related Query

More Query from same tag