pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Paterson <joseph.pater...@gmail.com>
Subject Re: context menu on treeNode
Date Sat, 07 Jul 2012 00:00:49 GMT
Hi Bruno,

You need to add implement the MenuHandler interface and set it on your
TreeView (you can just extend MenuHandler.Adapter to make your life
easier). In your configureContextMenu method, do something similar to this:

        public boolean configureContextMenu( Component component, Menu
menu, int x, int y )
            Menu.Section topLevelMenuSection = new Menu.Section();
            menu.getSections().add( topLevelMenuSection );
            Menu.Item menuItem = new Menu.Item( "My Menu Item ");
            topLevelMenuSection.add( menuItem );
            return false;

Hope this helps.


On Thu, Jul 5, 2012 at 7:28 PM, Bruno Rodrigues <brunord@gmail.com> wrote:

> hello, guys!
> you know how to create a listener to show a menu when pressing right click
> on a tree node? my question is clear?
> I have already a listener created for a right click, doing a simple
> System.out.print(), and I dont know how to add a context menu.
> thanks!

View raw message