| Summary: | [Compatibility] WorkbenchWindowControlContributions through toolbar:org.eclipse.ui.trim.status do not appear | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Michael Valenta <Michael.Valenta> | ||||||||||
| Component: | UI | Assignee: | Eric Moffatt <emoffatt> | ||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | bhunt, emoffatt, john.camelon, Mike_Wilson, Olivier_Thomann, pwebster, remy.suen, thatnitind, vasili.gulevich | ||||||||||
| Version: | 4.1 | ||||||||||||
| Target Milestone: | 4.2 M4 | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Michael Valenta
Here is the xml
<extension
point="org.eclipse.ui.menus">
<group
id="com.ibm.team.workitem.rcp.ui.SearchBarGroup"
separatorsVisible="true">
<location>
<bar type="trim"/>
<order position="before" relativeTo="status"/>
</location>
</group>
<widget class="com.ibm.team.workitem.rcp.ui.internal.quicksearch.SearchBarTrim" id="com.ibm.team.workitem.rcp.ui.SearchBar">
<location>
<bar path="com.ibm.team.workitem.rcp.ui.SearchBarGroup" type="trim"/>
</location>
<layout fillMajor="false" fillMinor="false"/>
</widget>
<group
id="com.ibm.team.workitem.rcp.ui.WorkitemActivationGroup"
separatorsVisible="true">
<location>
<order
position="after"
relativeTo="status">
</order>
<bar
type="trim">
</bar>
</location>
</group>
<widget
class="com.ibm.team.workitem.rcp.ui.internal.activation.ActiveWorkItemWorkbenchTrim"
id="com.ibm.team.workitem.rcp.ui.WorkitemActivationTrim">
<location>
<bar
path="com.ibm.team.workitem.rcp.ui.WorkitemActivationGroup"
type="trim">
</bar>
</location>
<layout
fillMajor="false"
fillMinor="true">
</layout>
</widget>
</extension>
(In reply to comment #1) > Here is the xml > > <extension > point="org.eclipse.ui.menus"> > <group > id="com.ibm.team.workitem.rcp.ui.SearchBarGroup" > separatorsVisible="true"> Michael, is there any reason that you don't use the normal org.eclipse.ui.menus syntax? There was never released a working version of this old syntax that wasn't backed by the o.e.ui.menus we released in 3.3 PW This isn't my code. It belongs to another component of RTC (Work Items). I don't know they history of it. Paul, are you saying that the XML code in question was never API and hence will not be supported in 4.x? I just ask because the lack of this trim widget is enough to keep me from using 4.1 on a daily basis. Created attachment 186264 [details]
plugin.xml
I had a full look back. This was released in 3.2 as experimental API and then deprecated in 3.3 (as a bad idea) and replaced with org.eclipse.ui.menus/menuContribution
Could you open a work item with the Jazz guys to get them to fix this? It should work from 3.3 on (although it should probably be tested if the claim is to still support RTC on 3.3).
As a workaround while we decide what to do (one of the benefits of moving to 4.x was the ability to walk away from useless deprecated API :-) could you try the org.eclipse.ui.menus extension from the attached plugin.xml in your setup (from a plugin that can see the 2 classes specified)? Then at least something should show up on your status bar.
PW
Created attachment 186414 [details]
Make the bottom trim into model elements
This is Step 0: Turn the current hacked trim code into real model code. This means that we now populate the model with the bottom trim elements (giving me something to place extensions relative 'to'.
This also cleans up a bit by having a far simpler code for the TrimBarLayout as well as moving the LayoutModifierToolControl into the same package as the layout itself.
An NPE is now thrown if you try to restart Eclipse with an editor open. ERROR: Unable to create class 'org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor' from bundle '2025' org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:59) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:828) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:808) at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:108) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:310) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:237) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:153) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:64) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53) at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:117) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:699) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:497) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:512) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:106) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:513) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:509) at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:69) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:699) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:497) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:509) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:509) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:509) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59) at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:59) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:509) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:106) at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:513) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:509) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59) at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:471) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:509) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:574) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:771) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:726) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:89) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:540) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:522) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:600) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) Caused by: java.lang.NullPointerException at org.eclipse.jface.action.StatusLineManager$1.done(StatusLineManager.java:165) at org.eclipse.ui.internal.WorkbenchWindow$8.run(WorkbenchWindow.java:1578) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1568) at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3217) at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3244) at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:332) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:600) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:52) ... 70 more (In reply to comment #7) > An NPE is now thrown if you try to restart Eclipse with an editor open. This seems to be a generic problem with the status line given that it's used as a progress monitor even if it hasn't been constructed. See bug 334093. Created attachment 186674 [details]
Part 2: Handle the deprecated (but used) extensions
This patch add the code to create model elements for the IWindowTrim based extensions from org.eclipse.ui.menus.
I still need to implement the 'proper' extensions (i.e. the ones that use a locationURI like "trim:org.eclipse.ui.status?after=status...).
Now on to remy's issue...
Committed in >20110112. Applied the patch. Created attachment 186734 [details] HACK ALERT !! This is an *interim* hack until JFace is fixed. This code should be removed once the fix for bug 334093 is in... Committed in >20110113. Applied the patch. (In reply to comment #11) > Created attachment 186734 [details] > HACK ALERT !! This is an *interim* hack until JFace is fixed. > > > This code should be removed once the fix for bug 334093 is in... I gave Eric an incorrect fix. I have rewritten his interim fix (above) with a less ugly one and have delivered it to HEAD. I wasn't sure what the state of this was so I tried it again on the latest I build (eclipse-SDK-I20110127-2200-win32-x86_64). The trim widget is still missing. I also tried the snipet Paul provided in comment 5 (against an Eclipse 3.5 target) and it didn't work. (In reply to comment #14) > The trim widget is still > missing. I also tried the snipet Paul provided in comment 5 (against an Eclipse > 3.5 target) and it didn't work. The reason the snippet doesn't work is because it assumes the trim widgets from RTC extends WorkbenchWindowControlContribution (which is not the case). (In reply to comment #9) > I still need to implement the 'proper' extensions (i.e. the ones that use a > locationURI like "trim:org.eclipse.ui.status?after=status...). RTC has changed their code to use the "toolbar:org.eclipse.ui.trim.status" location defined in MenuUtil.TRIM_STATUS now. We will need to support this sort of extension to get those trim widgets to appear. Pushed in >20111115. commit ea62329cce61835e868f858e3031d3d4b83af26e This works for my test cases (using Michael's contribution format with a Label and a Text field, let me know if there are any remaining issues... *** Bug 363942 has been marked as a duplicate of this bug. *** Looks good to me with I20111116-0810 on Windows 7. I'll verify again during M4's milestone week. Verified in I20111205-2330. NOTE: There is still a defect regarding the height of toolbars that contain only controls but this is apparently an SWT issue, not an artifact of this defect... Related comments are still left in org.eclipse.ui.internal.WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) // Temporary Hack for bug 330106, remove when bug 334093 is fixed boolean progressHack = manager.getControl() == null; if (manager == null || progressHack) { runnable.run(new NullProgressMonitor()); } else { ... Please open a new bug to re-examine the comments and code that are still there. PW |