This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 87231 - [PresentationAPI] Offer ability to alter part's toolbar presentation
Summary: [PresentationAPI] Offer ability to alter part's toolbar presentation
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-06 00:29 EST by Chris Gross CLA
Modified: 2014-05-02 04:48 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Gross CLA 2005-03-06 00:29:58 EST
The toolbar associated with each part is managed by the workbench internals 
and not by the presentation.  The presentation can only alter the toolbar's 
size and location.  Properties such as the background color, foreground, and 
font cannot be accessed because the Control available in IPresentablePart is 
not the toolbar itself, but a wrapper instead.

Ideally, the presentation could be able to decide whether a ToolBar even makes 
sense or whether a seperate UI for the actions is desirable.
Comment 1 Chris Gross CLA 2005-03-06 00:32:41 EST
Bug 82523 seems related.
Comment 2 Stefan Xenos CLA 2005-03-07 16:00:41 EST
Ideally, the part should describe what it wants on the toolbar and the
presentation should create the widgets for it. This would mean that each
StackPresentation that contains a part may use a different widget for that
part's toolbar.

This is not an easy code change, since views and editors can gain access to the
actual toolbar widget through their contribution items, and many of them hang
onto it... preventing it from being destroyed and recreated, and preventing
there from being more than one widget for the same contribution item.

The UI team does not have time to address this issue at the current time. If you
are interested in working on this issue, please let me know.
Comment 3 Chris Gross CLA 2005-03-07 16:30:40 EST
As a short-term solution, could the setFont(), setBackground() and 
setForeground() methods on the Composite "wrapper" for the toolbar, delegate 
out to the actual toolbar?  That way I would be able to actually change the 
background color of the toolbar (what I'm trying to do, similar to Bug 
82523).  
Comment 4 Stefan Xenos CLA 2005-03-08 14:41:31 EST
Exposing those methods would be problematic. It would change the toolbar color
in all perspectives that contain the view, and the APIs would be need to be
broken if the presentation gets the power to actually create the toolbar widgets.

Another possiblity:

IPresentablePart could gain API that describes the items it wants on its toolbar
(but does not actually create them). The presentation could then create whatever
widget it wants for the toolbar.

In order to maintain compatibility with existing ContributionItems, the actual
view would need to convert its existing toolbar to the new API. This could be
done by creating an invisible ToolBar in which the view could create its items.
The new API could forward events to the hidden widget by using SWT's
notifyListeners API.
Comment 5 Chris Gross CLA 2005-03-08 16:44:03 EST
Those methods are already exposed.  The IPresentablePart interface has the 
getToolBar() method which returns a Composite with those methods.  I'm simply 
asking for them to be delegated through to the ToolBar inside that Composite.  

As for the other possibility that sounds good, but I'm still a little fuzzy on 
where the actual ToolBar reference is leaking through.  
Comment 6 Paul Webster CLA 2006-09-28 15:14:30 EDT
Is this still a problem in 3.3?

PW
Comment 7 Chris Gross CLA 2006-09-28 15:26:59 EDT
I'm not following the presentation changes for 3.3, but for this bug to be resolved would require the toolbar representation to be moved into the presentations API.  In 3.2 and previous, the way to add toolbar items was to use IPresentablePart.getToolBar which returned the toolbar that was already created and populated by the workbench internals.  Instead, there needs to be some new way to access the contributed actions from within the presentation API that allows it to render those action however it wished.
Comment 8 Paul Webster CLA 2006-09-28 19:32:36 EDT
There is work going on right now to allow finer contribution control to menus and toolbars, but there's no one looking at the presentation API for 3.3.  It looks like the presentation API will still only be responsible for placement of the view pane, view menu, and view toolbar, not their rendering.

PW
Comment 9 Paul Webster CLA 2009-03-02 11:39:37 EST
Updated as per http://wiki.eclipse.org/Platform_UI/Bug_Triage
PW
Comment 10 Lars Vogel CLA 2014-05-02 04:48:07 EDT
The PresentationAPI has been deprecated with the Eclipse 4.x release and it has been replaced with the CSS engine. I therefore close this bugs as WONTFIX. In case your bug report is still valid for the Eclipse 4.4 release, please open a new bug report for it.