Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCustomization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1387835/#msg_1387835
I managed to achieve that by registering custom renderer factory, which simply is a subclass of DefWorkbenchRendererFactory with overridden getToolItemRendererClass() and getToolItemMenuRendererClass() methods. The problem now is that in order to create custom renderers I need to copy much part of the code from DefToolItemRenderer and DefToolItemMenuRenderer in order to customize their behavior. The methods I need to change are private so I can't solve it by extending them.
My question is, if the way I do it is correct or there is some another approach I overlooked?
Thanks,
Jacek ]]>Jacek Bukowski2014-06-25T17:03:34-00:00Re: Customization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1387904/#msg_1387904
On 25.06.14 19:03, Jacek Bukowski wrote:
> In my application I need to customize the way the MToolItem with MMenu
> is rendered. Rather than default SplitMenuButton with ContextMenu, I
> would like to have something like Button which opens a
> javafx.stage.Popup with MenuItems rendered in rows (rows ends on
> separator). I managed to achieve that by registering custom renderer
> factory, which simply is a subclass of DefWorkbenchRendererFactory with
> overridden getToolItemRendererClass() and getToolItemMenuRendererClass()
> methods. The problem now is that in order to create custom renderers I
> need to copy much part of the code from DefToolItemRenderer and
> DefToolItemMenuRenderer in order to customize their behavior. The
If you tell me which methods then I can make them protected - still I'd
like to mention that the renderer themselves are not API we'll publish
so you could be broken anytime.
> methods I need to change are private so I can't solve it by extending them.
> My question is, if the way I do it is correct or there is some another
> approach I overlooked?
>
Yes that's the way to go - in 1.1 I plan to provide a way to contribute
renderers to DefWorkbenchRendererFactory using OSGi-Services, so that
you don't need to subclass it.
Another proposal I have for you would be that you contribute your
renderer to e(fx)clipse so that people can flip between the current
split-button and your way of rendering similar to how they can do that
today for the stack-renderer.
Tom]]>Thomas Schindl2014-06-25T19:05:24-00:00Re: Customization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1388299/#msg_1388299
Jacek Bukowski2014-06-26T08:26:36-00:00Re: Customization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1389129/#msg_1389129
Jacek Bukowski2014-06-27T11:33:44-00:00Re: Customization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1389138/#msg_1389138
Tom
On 27.06.14 13:33, Jacek Bukowski wrote:
> I am looking at the newest master branch and I can't see any other Stack
> renderer then DefStackRenderer. Do I miss something?]]>Thomas Schindl2014-06-27T11:46:19-00:00Re: Customization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1389380/#msg_1389380
The one drawback is that javafx.stage.Popup does not allow any styling (so also does not have any look itself), so my popup is quite ugly.
Any comments appreciated.
]]>Jacek Bukowski2014-06-27T18:24:03-00:00Re: Customization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1391050/#msg_1391050
]]>Uwe San2014-06-30T11:23:24-00:00Re: Customization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1393777/#msg_1393777
Tom
On 30.06.14 13:23, Uwe San wrote:
> As Jacek said, some details still need to be discussed, but it would be
> very much appreciated if this approach made it into e(fx)clipse. :)]]>Thomas Schindl2014-07-04T08:46:26-00:00Re: Customization of the MToolItem rendering
https://www.eclipse.org/forums/index.php/mv/msg/782666/1393813/#msg_1393813
https://bugs.eclipse.org/bugs/show_bug.cgi?id=438908]]>Jacek Bukowski2014-07-04T09:57:35-00:00