Bug 73513 - [RCP] statusline manager cannot be replaced
Summary: [RCP] statusline manager cannot be replaced
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P5 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2004-09-08 21:29 EDT by Jean-Michel Lemieux CLA
Modified: 2022-02-07 14:37 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Michel Lemieux CLA 2004-09-08 21:29:53 EDT
3.0
In my RCP application I want more control of the status line, in particular the
ability to turn off the progress region and status message. Or at least control
their ordering. The problem I have is that in the applications status line all I
have are two contribution items, when the app runs it looks bad to have the two
randomly appearing in somewhat of the middle of the status line with no visual
clue that they shouldn't be aligned to the left.

I could go off and write my own status line and in the workbench advisor
overwrite the createWindowContents() method. A better solution would be to allow
a workbench advisor to override the status line manager with it's own. This
would keep all existing plug-ins code that uses the status line compatible with
standalone applications and if running in another product. Since the status line
is simply another contribution manager, this seems like a reasonable request.
Comment 1 Nick Edgar CLA 2004-09-09 13:03:10 EDT
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.

Comment 2 Nick Edgar CLA 2004-09-09 13:03:59 EDT
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).
Comment 3 Jean-Michel Lemieux CLA 2004-09-09 15:37:30 EDT
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?
Comment 4 Nick Edgar CLA 2004-09-09 15:52:11 EDT
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.
Comment 5 Stephen Goldbaum CLA 2004-10-22 12:12:35 EDT
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?
Comment 6 Jean-Michel Lemieux CLA 2004-11-10 21:37:19 EST
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?
Comment 7 Jean-Michel Lemieux CLA 2004-11-10 22:12:01 EST
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?
Comment 8 Nick Edgar CLA 2004-11-11 09:55:23 EST
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
Comment 9 Jean-Michel Lemieux CLA 2004-11-11 10:01:23 EST
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.
Comment 10 Nick Edgar CLA 2004-11-11 12:13:00 EST
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.

Comment 11 Nick Edgar CLA 2006-03-15 11:24:19 EST
Reassigning bugs in component areas that are changing ownership.
Comment 12 Boris Bokowski CLA 2009-11-26 16:15:02 EST
Prakash is now responsible for watching bugs in the [RCP] component area.
Comment 13 Eclipse Webmaster CLA 2019-09-06 16:16:06 EDT
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.
Comment 14 Eclipse Genie CLA 2022-02-07 14:37:19 EST
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.