Community
Participate
Working Groups
Build Identifier: 20110916-0149 In the method doDisposePart(), from the class ViewReference (org.eclipse.ui.workbench) an explicit cast is made to ViewActionsBars (forcing the use of this class from an internal package). However, no specific method is used from ViewActionsBars, only the dispose() method available in the superclass SubActionBars. A patch was provided. Reproducible: Always
Created attachment 208730 [details] Patch
That's correct. This interface is not designed to be substituted. IViewSite/IActionBars is not a contract for the framework to use amongst its implementation, but a contract that exposes part of the framework services to the client code. What are you trying to do that you want to substitute this? PW
I wanted to provide my own implementation of IActionBars, to use it from an action contributor to the context menu of a view. I tried to subclass from SubActionBars, but I get a ClassCastException, from the method doDisposePart(), from ViewReference class.
(In reply to comment #3) > I wanted to provide my own implementation of IActionBars, to use it from an > action contributor to the context menu of a view. IActionBars aren't really involved with context menus, only with the view toolbar and the view dropdown menu. What do you want the IActionBars to do? PW
(In reply to comment #4) > (In reply to comment #3) > > I wanted to provide my own implementation of IActionBars, to use it from an > > action contributor to the context menu of a view. > > IActionBars aren't really involved with context menus, only with the view > toolbar and the view dropdown menu. > > What do you want the IActionBars to do? > > PW I wanted to contribute, using my implementation of IActionBars to the context menu of a view, that displays information in a table (with actions available on lines and columns), in a similar and uniform way with the contribution to a view's toolbar and dropdown menu. Indeed, it is stated that the IActionBars interface is not intended to be implemented by clients, but is the explicit cast made in doDisposePart() useful ?
(In reply to comment #5) > Indeed, it is stated that the IActionBars interface is not intended to be > implemented by clients, but is the explicit cast made in doDisposePart() useful > ? It's symmetric. Even in that one class, I was able to find (ContributionManager) getActionBars.getMenuManager() etc. And in 4.2, it won't work at all as the internal implementation changes. PW
We use git now for our source (it looks like you created your patch against CVS). By inspection, your patch seems harmless. If you could re-submit it against our git stream (the R3_development branch of eclipse.platform.ui git repo) I'll include it in 3.8 See http://wiki.eclipse.org/Platform_UI/How_to_Contribute for instructions. PW
(In reply to comment #7) > We use git now for our source (it looks like you created your patch against > CVS). By inspection, your patch seems harmless. If you could re-submit it > against our git stream (the R3_development branch of eclipse.platform.ui git > repo) I'll include it in 3.8 > > See http://wiki.eclipse.org/Platform_UI/How_to_Contribute for instructions. > > PW (In reply to comment #7) > We use git now for our source (it looks like you created your patch against > CVS). By inspection, your patch seems harmless. If you could re-submit it > against our git stream (the R3_development branch of eclipse.platform.ui git > repo) I'll include it in 3.8 > > See http://wiki.eclipse.org/Platform_UI/How_to_Contribute for instructions. > > PW Hello Paul and Happy New Year! I'm not sure if I understood correctly how to create the patch if you are not a commiter. In order to create the patch against git, do I have to create a branch, commit the change and then create the patch?
Yes - the latest build from egit should support direct patch creation. See bug #341036
I created a patch with the latest build from egit and attached it. Hope it is a valid file.
Created attachment 209137 [details] Patch for ViewReference class
(In reply to comment #11) > Created attachment 209137 [details] > Patch for ViewReference class Hi Florina, and thanx for the patch. Comments: You release the menu manager twice and forgot to release the toolbar manager. Aside from that it's good. If you provide another patch, I should be able to get it in. PW
Created attachment 209258 [details] Patch 2 for ViewReference class
Released to R3_development only. Thank you for the patch. PW
In I20120123-1800 PW