pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Rodrigues <brun...@gmail.com>
Subject Re: context menu on treeNode
Date Sat, 07 Jul 2012 12:56:56 GMT
thanks very much!!

2012/7/7 Joseph Paterson <joseph.paterson@gmail.com>

> 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:
>
>         @Override
>         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.
>
> Joseph.
>
>
> 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!
>>
>
>

Mime
View raw message