Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » ClassCastException in PopupMenuService
ClassCastException in PopupMenuService [message #1239496] Tue, 04 February 2014 10:08 Go to next message
Sun Volland is currently offline Sun VollandFriend
Messages: 29
Registered: September 2010
Junior Member
Hi,

When using the PopupMenuService to register a ContextMenu on a TreeCell, I get the following ClassCastException :

org.eclipse.fx.ui.workbench.renderers.fx.DefPopupMenuRenderer$ContextMenuImpl cannot be cast to javafx.scene.control.ContextMenu
at org.eclipse.fx.ui.workbench.renderers.fx.services.PartPopupMenuServiceImpl.registerMenu(PartPopupMenuServiceImpl.java:44)

I guess the problem is due to to the following line (44) in PartPopupMenuServiceImpl.registerMenu() :

return (ContextMenu) menu.getWidget();

which should instead be :

return (ContextMenu)((WPopupMenu<ContextMenu>) menu.getWidget()).getWidget();

Can one confirm this is a bug ?

Sun


Re: ClassCastException in PopupMenuService [message #1239506 is a reply to message #1239496] Tue, 04 February 2014 10:34 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes this looks wrong - unfortunately it is to late for 0.9.0 which has
already been released - if you need this you'll have to get the sources
from git and patch it locally!

Please file a bug so that we can fix it in 1.0.0.

Tom

On 04.02.14 11:08, Sun Volland wrote:
> Hi,
>
> When using the PopupMenuService to register a ContextMenu on a TreeCell,
> I get the following ClassCastException :
>
> org.eclipse.fx.ui.workbench.renderers.fx.DefPopupMenuRenderer$ContextMenuImpl
> cannot be cast to javafx.scene.control.ContextMenu
> at
> org.eclipse.fx.ui.workbench.renderers.fx.services.PartPopupMenuServiceImpl.registerMenu(PartPopupMenuServiceImpl.java:44)
>
>
> I guess the problem is due to to the following line (44) in
> PartPopupMenuServiceImpl.registerMenu() :
>
> return (ContextMenu) menu.getWidget();
>
> which should instead be :
>
> return (ContextMenu)((WPopupMenu<ContextMenu>)
> menu.getWidget()).getWidget();
>
> Can one confirm this is a bug ?
>
> Sun
>
>
>
Previous Topic:Newbie question about including efxclipse into existing targe
Next Topic:e(fx)clipse 0.9.0 has been released
Goto Forum:
  


Current Time: Tue Apr 23 13:23:34 GMT 2024

Powered by FUDForum. Page generated in 0.03533 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top