| Summary: | [RCP] statusline manager cannot be replaced | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jean-Michel Lemieux <jean-michel_lemieux> |
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P5 | CC: | emoffatt, jeffmcaffer, Michal.Tkacz, stephen.goldbaum |
| Version: | 3.0 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
|
Description
Jean-Michel Lemieux
This is already possible via the presentation factory mechanism. See AbstractPresentationFactory.createStatusLineManager and createStatusLineControl. But there should be more control over placement in the default setup, as you describe. One downside of the current approach is that you can't replace the status line independently of the rest of the presentation (i.e. view/editor presentation). The workaround is to create your own presentation factory and delegate the createEditorPresentation and createViewPresentation to the WorkbenchPresentationFactory (which is API) and return your own status line. Then simply set the presentation preference in your workbenchadvisor and voila. Do you have any problems with subclassing WorkbenchPresentationFactory? While this would work, a better approach would be to get the previous
presentation factory from IWorkbenchWindowConfigurer.getPresentationFactory()
and delegate to it for the other methods. That is, from preWindowOpen:
configurer.setPresentationFactory(
new StatusLineReplacementPresentationFactory(
configurer.getPresentationFactory());
This preserves the ability to customize the presentation factory via the
IWorkbenchPreferenceConstants.PRESENTATION_FACTORY_ID preference in
plugin_customization.ini.
I'd also like to reorder the ProgressIndicator for the same reasons. I don't see how this is possible without writing complete duplicates of the StatusLine and StatusLineManager classes, since the ProgressIndicator placement is controlled in the package level StatusLine class. Other than that, how would you go about moving the ProgressIndicator? Yes you have to copy. Nick, the methods you recommend using for setting/getting the presentation factory are deprecated? Is this an approach that should be explained publicly? Another more important note, it is actually impossible to implement what you have recommended. The reason is that the workbench window creates the StatusLineManager in it's constructor, delegating to the presentation factory. If an advisor needs to override, it would have to proxy the presentation factory *before* preWindowOpen() is called. This can't be done because the IWorkbenchWindowConfigurer isn't available at that time. Since the presentation isn't scoped to a particular window, could it be made accessible via the IWorkbenchConfigurer instead? The recommended way to override the presentation is to specify org.eclipse.ui/presentationFactoryId=<yourPresentationFactoryId> in the plugin_customization.ini file for the product. For more details, see http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-ui-home/rcp/faq.html#customPrefs I know, but the whole point was not to override the presentation but to proxy it. That was your suggestion from the very beginning :) Otherwise, you can simply wrap the WorkbenchPresentationFactory and register as you said. Oh, right.
We could change the order of things in WorkbenchWindow's constructor.
E.g. move
addMenuBar();
addCoolBar(SWT.FLAT);
addStatusLine();
after
getAdvisor().preWindowOpen(getWindowConfigurer());
But that would really be only in support of the deprecated APIs.
I no longer think it makes sense to tie the status line customization to the
presentation factory. Apps should have full control over the status line,
independent of the presentation, in the same way they do over menus and coolbars.
We should chat about the best way to do this.
Reassigning bugs in component areas that are changing ownership. Prakash is now responsible for watching bugs in the [RCP] component area. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |