Users often find it necessary to filter views such as the navigator view in
order to reduce clutter. Plug-ins can assist in filtering using different
can be used to filter by file name. Plug-ins contribute resource
filters that the user can enable using a view's filter selection dialog.
Working sets can be used to filter resources by only including
specified resources. Working sets are selected using the view's
working set dialog.
If your plug-in implements a view that shows resources (or objects that are
you should support working sets.
provides API for manipulating working sets. You can obtain an
IWorkingSetManager manager = workbench.getWorkingSetManager();
allows you to manipulate and create working sets:
createWorkingSetSelectionDialog - returns a working set dialog that shows the user the current working
sets. You can get the selected working sets from the dialog once it is
createWorkingSetEditWizard - returns a working set edit wizard for editing the specified working
getWorkingSets() - returns a list of all defined working sets
getWorkingSet(String name) - returns a working set specified by
also provides property change notification as working sets are added,
removed, or as they change. If your view or editor needs to respond to
changes in the selected working set, it can add a listener for CHANGE_WORKING_SET_CONTENT_CHANGE.
Adding new working set types
For many plug-ins, using
to provide resource filtering is sufficient. If your plug-in needs to
define working sets differently, it can register a new type of working set using
The Java tooling uses this feature to define a Java working set type.
Working set types are shown when the user decides to add a working set.
When you define your own type of working set, you can use
IWorkingSet.getId protocol to ensure that the working set matches the type that you have
defined. Any working sets that you create programmatically must have
their id set to the id of a working set page that can display the working
set elements. This id is used to ensure that the proper working set
edit page is launched when the user edits the working set. A null
id indicates that the working set should use the default resource working
extension point documentation and
protocol for more detail.