Bug 201055 - [RCP] Limit offered perspectives in the perspective chooser
Summary: [RCP] Limit offered perspectives in the perspective chooser
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, helpwanted
Depends on:
Blocks: 201121
  Show dependency tree
 
Reported: 2007-08-24 04:49 EDT by Tonny Madsen CLA
Modified: 2008-05-16 14:14 EDT (History)
2 users (show)

See Also:


Attachments
Patch for bug (5.67 KB, patch)
2007-08-25 18:19 EDT, Tonny Madsen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tonny Madsen CLA 2007-08-24 04:49:28 EDT
Version: 3.3.0
Build id: I20070621-1340

Many RCP applications have multiple workbench windows each with a specific function. Each window might have a number of perspectives, but you don't want to be able to open all perspectives in all windows, only those that are relevant for the specific function of the window. This is not possible with the current perspective chooser - actually it is not even possible to avoid the "open perspective" button or to limit the set of perspectives that are offered in the menu.
Comment 1 Tonny Madsen CLA 2007-08-24 06:19:37 EDT
Some of this functionality is already described in bug 190083.
Comment 2 Tonny Madsen CLA 2007-08-25 18:19:45 EDT
Created attachment 76976 [details]
Patch for bug

This patch is as simple as possible.

Two new API preferences has been introduced. They are both intended to be used in a plugin_customization.ini file and thus there are no property change management involved nor are they present in the preference pages.
- SHOW_OPEN_ON_PERSPECTIVE_BAR: if true (the default), will the "open perspective" button be present in the perspecive bar.
- SHOW_OTHER_IN_PERSPECTIVE_MENU: if true (the default), will the "Other..." button be present in the perspecive menu.
The two preferences can be combined, but for the sake of simplicity, they have been kept apart.

If property change management is wanted, only SHOW_OPEN_ON_PERSPECTIVE_BAR is affected. Note though, that this means additional changes in the PerspectiveBarManager as well as this assumes the first real perspective has index 1 (and not 0).
Comment 3 Boris Bokowski CLA 2007-09-12 09:26:37 EDT
Patch released >20070912. Tonny, thanks for the patch and keep it coming!

Just one thing to think about - with this being a preference, it can be changed for each workspace, and in theory by the end user. Another way would have been to add this to the workbench window configurer instead, which ensures that it can only be set by the application. It would also fit well between the other setShow...() methods on IWorkbenchWindowConfigurer.

You can earn extra points for submitting a patch that modifies your solution to use the workbench window configurer mechanism rather than a preference. :)