Attach a listener to the tree and select the event as treeEventObj's
right click.
But it will work only with jdk 1.5 and not jdk 1.6.

Create a Menu inside the "isRightClick" condition,and attach the menu
to the tree as context menu.
Please see the sample code below:-



 tree.addListener( Events.SelectionChange, new Listener<TreeEvent>() {
      public void handleEvent( final TreeEvent treeEventObj)
      {
        if( treeEventObj.isRightClick() ) {
          final Menu contextMenu = new Menu();
          contextMenu.setWidth( 130 );
          final MenuItem addNodeMenu = new MenuItem( "Menu A" );
         final MenuItem addAttributeMenu = new MenuItem( "Menu B" );
          contextMenu.add( addNodeMenu );
          contextMenu.add( addAttributeMenu );
          tree.setContextMenu( contextMenu );
        }

       }
  });

On Sep 30, 2:20 pm, ArunDhaJ <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm overriding the onBrowserEvent event of Tree for capturing mouse
> right click, for generating context menu. How to get the Tree Item
> which has been right clicked in onBrowserEvent?
>
> else is there any way to capture right click event of TreeItem?
>
> Thanks in Advance
>
> -ArunDhaJ

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to