Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 284388 - [Compatibility] editor action bar contributions appear at the end of the top trim
Summary: [Compatibility] editor action bar contributions appear at the end of the top ...
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 0.9   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.1 RC3   Edit
Assignee: Project Inbox CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-23 05:21 EDT by Paul Webster CLA
Modified: 2011-06-06 11:23 EDT (History)
3 users (show)

See Also:


Attachments
Patch to clean up TB rendering (35.02 KB, patch)
2011-05-18 15:28 EDT, Eric Moffatt CLA
no flags Details | Diff
Revised patch to address view Menu / TB Issues (41.24 KB, patch)
2011-05-20 14:03 EDT, Eric Moffatt CLA
no flags Details | Diff
Stack rendering patch v1 (774 bytes, patch)
2011-05-24 13:02 EDT, Remy Suen CLA
no flags Details | Diff
Patch to clean up missing TB's (4.48 KB, patch)
2011-05-24 14:19 EDT, Eric Moffatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2009-07-23 05:21:48 EDT
If an editor updates its action bars and adds menus or tool items, they don't show up.  The menus and toolbars have snapshots taken when they are created and then the model is used from then on, and that doesn't handle updates.

PW
Comment 1 Paul Webster CLA 2011-05-13 14:24:22 EDT
The editor toolbar (from the editor action bars, as opposed to an actionSetPartAssociation) now appears for editors that use one.

After the quickaccess text and perspective switcher.  Doh!

PW
Comment 2 Eric Moffatt CLA 2011-05-13 15:53:13 EDT
This is a result of a misunderstanding about how the PRE works...it's *imperative* that the widget that gets bound to the model element is the one that represents the element. In this case the TrimBarRenderer was 'wrapping' the toolbars in a composite but not adjusting the bound widget.

If we revert the change to the TrimBarRenderer then all is well except that we don't get the separators anymore...

Likely we will have to go back to the old-style where the renderer for the Toolbars will create the composite...this implies that any code that currently thinks that <MToolBar>.getWidget() is an SWT toolbar will need to be adjusted.

Note that the current code also affects the layout behavior for minimized stacks, causing cheese...
Comment 3 Eric Moffatt CLA 2011-05-18 15:28:36 EDT
Created attachment 196041 [details]
Patch to clean up TB rendering


This also seems to address:

bug 341497 Minimized editor is clipped
bug 345193 Too many icon separators in toolbar

as well as 'most' of the extra separators...
Comment 4 Remy Suen CLA 2011-05-19 09:27:55 EDT
Comment on attachment 196041 [details]
Patch to clean up TB rendering

(In reply to comment #3)
> This also seems to address:
> 
> bug 341497 Minimized editor is clipped

Check.

> bug 345193 Too many icon separators in toolbar

Check.

Bug 346096 also seems to be good also.

PartRenderingEngineTests now has several additional failures.

'Problems' view doesn't have a view menu. In fact, the whole bottom stack is screwed, changing the selection of the bottom stack will cause exceptions.

java.lang.IllegalArgumentException: Argument not valid
	at org.eclipse.swt.SWT.error(SWT.java:4258)
	at org.eclipse.swt.SWT.error(SWT.java:4192)
	at org.eclipse.swt.SWT.error(SWT.java:4163)
	at org.eclipse.e4.ui.widgets.CTabFolder.removeTabControl(CTabFolder.java:3785)
	at org.eclipse.e4.ui.widgets.CTabFolder.setTopRight(CTabFolder.java:3383)
	at org.eclipse.e4.ui.widgets.CTabFolder.setTopRight(CTabFolder.java:3348)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.hideElementRecursive(LazyStackRenderer.java:162)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.access$0(LazyStackRenderer.java:143)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:64)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4681)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:182)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$3.widgetSelected(StackRenderer.java:484)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
	at org.eclipse.e4.ui.widgets.CTabFolder.setSelection(CTabFolder.java:2991)
	at org.eclipse.e4.ui.widgets.CTabFolder.onMouse(CTabFolder.java:1707)
	at org.eclipse.e4.ui.widgets.CTabFolder$1.handleEvent(CTabFolder.java:270)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:944)
Comment 5 Remy Suen CLA 2011-05-19 12:12:39 EDT
Editor toolbars also disappear ('Toggle Mark Occurrences', 'Show Whitespace Characters', etc.) with the suggested patch.
Comment 6 Eric Moffatt CLA 2011-05-20 14:03:21 EDT
Created attachment 196240 [details]
Revised patch to address view Menu / TB Issues


NOTE: While there are still some glitches in this solution I'd rather go with this because it re-arranges how the various TB's get rendered (the cause of a number of known issues)...

There is still some issue on being too aggressive on 'DisposeToolbarIfNecessary', causing the java editor's toolbar to only appear after doing a 'Window->New Window'.

There are still some gaps after switching between the Java and Compare editors, not sure why yet.
Comment 7 Paul Webster CLA 2011-05-20 15:07:17 EDT
(In reply to comment #6)
> NOTE: While there are still some glitches in this solution I'd rather go with
> this because it re-arranges how the various TB's get rendered (the cause of a
> number of known issues)...
> 
> There is still some issue on being too aggressive on
> 'DisposeToolbarIfNecessary', causing the java editor's toolbar to only appear
> after doing a 'Window->New Window'.
> 

that toolbar is constructed by actionSets.  So when the empty window is coming up, there will never be any SWT toolitems in the toolbar.  They show up later, when the perspective activates the actionSets for the actionSetPartAssociations.

PW
Comment 8 Eric Moffatt CLA 2011-05-20 15:42:24 EDT
Committed in >20100520. Applied the patch.

Checking in the big changes, we'll tackle the edges I've created next...
Comment 9 Remy Suen CLA 2011-05-24 13:02:51 EDT
Created attachment 196469 [details]
Stack rendering patch v1

If you have both the 'Package Explorer' and 'Project Explorer' in the same stack, switching between them will not make the view menu immediately visible. Forcing a layout by resizing the stack will bring them back.
Comment 10 Eric Moffatt CLA 2011-05-24 14:19:47 EDT
Created attachment 196475 [details]
Patch to clean up missing TB's


This strategy allows 'empty' managed toolbars (i.e. a Composite with two toolbars, the second of which has no items) to exist and filters them out in the TrimBarLayout...
Comment 11 Eric Moffatt CLA 2011-05-24 14:34:39 EDT
Committed in >20110524. Applied the patch.
Comment 12 Eric Moffatt CLA 2011-06-06 11:23:43 EDT
Verified in I20110604-2201