Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » How to use EMenuService to register ContexMenu on Circle
How to use EMenuService to register ContexMenu on Circle [message #1717643] Tue, 15 December 2015 14:13 Go to next message
Ali Karimi is currently offline Ali KarimiFriend
Messages: 36
Registered: October 2015
Member
Hey there,

currently i am having problems in registering a contextmenu using the EMenuService on a Circle node. I am able to register a ContexMenu on a TableViewer in my code, so the setup of the menu should be okay. However, if i try to register the menu on a circle node it doesn't work, see the following code of my @PostConstruct method which is declared in my part.
The code example that works:
    @Inject
    EMenuService menuService;
    StackPane stackPane;
    
    @PostConstruct
    public void postConstruct(final BorderPane p) {
        stackPane = new StackPane();        
        final TableView<MyObject> myTable = new TableView<MyObject>();
        stackPane.getChildren()
        .add(myTable );
        p.setCenter(stackPane);
        menuService.registerContextMenu(myTable , "de.test.popupmenu.0");        
    }

The code example that does not work:
    @Inject
    EMenuService menuService;
    StackPane stackPane;

    @PostConstruct
    public void postConstruct(final BorderPane p) {
        stackPane = new StackPane();
        final Circle cir = new Circle(50);
        stackPane.getChildren()
               .add(cir);
        p.setCenter(stackPane);
        menuService.registerContextMenu(cir, "de.test.popupmenu.0");        
    }


What am i missing here?
Is there anything special to circle nodes compared to TabelView?
Thanks in adavnce
Re: How to use EMenuService to register ContexMenu on Circle [message #1717648 is a reply to message #1717643] Tue, 15 December 2015 14:20 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
JavaFX does not have a context menu implementation on Node but that API
is found on Control!

You can file a bug-report asking use to implement context-menus on any
Node provided, as of today I think simply skip none control-nodes provided.

Tom

On 15.12.15 15:13, Ali Karimi wrote:
> Hey there,
>
> currently i am having problems in registering a contextmenu using the
> EMenuService on a Circle node. I am able to register a ContexMenu on a
> TableViewer in my code, so the setup of the menu should be okay.
> However, if i try to register the menu on a circle node it doesn't work,
> see the following code of my @PostConstruct method which is declared in
> my part.
> The code example that works:
>
> @Inject
> EMenuService menuService;
> StackPane stackPane;
> @PostConstruct
> public void postConstruct(final BorderPane p) {
> stackPane = new StackPane(); final
> TableView<MyObject> myTable = new TableView<MyObject>();
> stackPane.getChildren()
> .add(myTable );
> p.setCenter(stackPane);
> menuService.registerContextMenu(myTable ,
> "de.test.popupmenu.0"); }
>
> The code example that does not work:
>
> @Inject
> EMenuService menuService;
> StackPane stackPane;
>
> @PostConstruct
> public void postConstruct(final BorderPane p) {
> stackPane = new StackPane();
> final Circle cir = new Circle(50);
> stackPane.getChildren()
> .add(cir);
> p.setCenter(stackPane);
> menuService.registerContextMenu(cir,
> "de.test.popupmenu.0"); }
>
>
> What am i missing here?
> Is there anything special to circle nodes compared to TabelView?
> Thanks in adavnce
Re: How to use EMenuService to register ContexMenu on Circle [message #1717649 is a reply to message #1717643] Tue, 15 December 2015 14:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Probably the issue is that TableView is a Control while Circle is a Shape. I haven't looked into the EMenuService implementation of e(fx)clipse now, but I suppose that might be the issue.
Re: How to use EMenuService to register ContexMenu on Circle [message #1717656 is a reply to message #1717649] Tue, 15 December 2015 15:03 Go to previous message
Ali Karimi is currently offline Ali KarimiFriend
Messages: 36
Registered: October 2015
Member
Yes indeed, this seems to be the root cause of my problem.
Thanks for the fast help.
Previous Topic:e(fx)clipse 2.2.0 released
Next Topic:Missing dependencies for p2 updates
Goto Forum:
  


Current Time: Thu Apr 25 18:57:09 GMT 2024

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

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

Back to the top