Bug 337485 - e4 should use shell toolbar where possible
e4 should use shell toolbar where possible
Status: NEW
Product: e4
Classification: Eclipse
Component: UI
0.9
Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
: ---
Assigned To: Project Inbox CLA Friend
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-02-17 15:14 EST by Brian de Alwis CLA Friend
Modified: 2011-09-08 16:51 EDT (History)
3 users (show)

See Also:


Attachments
Work in progress (1016 bytes, application/octet-stream)
2011-02-17 15:14 EST, Brian de Alwis CLA Friend
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA Friend 2011-02-17 15:14:33 EST
Created attachment 189224 [details]
Work in progress

Bug 222859 introduced the notion of a shell's toolbar (Shell#getToolBar()).  On MacOS X, this is the native toolbar, which is seamless with the titlebar.  e4 should support using this toolbar.

I've tried a few experiments to adapt the e4.swt renderers to use this toolbar.  Although the toolbar is an instance of o.e.swt.widgets.ToolBar, it's not a fully functional TB: it doesn't support embedding composites.  This means we can't embed ToolBars within the shell ToolBar.

I tried two approaches:

1. Changing the TrimBarRenderer to return the shell ToolBar if the trim side is TOP.  This approach didn't work well as the actual toolbars are instantiated against the shell ToolBar and never displayed.

2. Changing the ToolBarRenderer to return the shell ToolBar if the MToolBar's parent is a MTrimBar and the trim side is TOP.  This approach works for simple examples (e.g., the e4 Contacts demo).  The patch isn't sufficient for the 4.1 SDK IDE though: although the platform toolbar appears, nothing appears and there is a second ToolBar with the quick-access search and the perspective switcher.

Given the restrictions on the shell toolbar, I wondered if it might make sense to only use the platform toolbar for MToolBars with a particular ID.

The experiments required patching SWT to avoid NPEs on startup (bug 337484).
Comment 1 Brian de Alwis CLA Friend 2011-02-18 14:05:17 EST
SWT is reworking these APIs.  Their work is being discussed in bug 222859#c135 and bug 325795.