well in my case i have to create a TreeNode extends FocusPanel and overrride
the onBrowserEvent then i used new TreeItem(new TreeNode()));
i also used TreeNode to override the tree icons/images for any tree level i
want.

On Thu, Jul 1, 2010 at 6:52 PM, Jim Douglas <[email protected]> wrote:

> I listen for the right-click event on the Tree, then do a hit test of
> the point to identify the corresponding TreeItem.  And don't forget to
> call preventDefault() on the event to suppress the browser's default
> context menu.  (That last part works in Opera 10.5x, but Opera 10.10
> ignores it and puts up the context menu anyway.)
>
> On Jul 1, 8:24 am, Yaakov <[email protected]> wrote:
> > Well, TreeItem does not inherit from a Widget, so it doesn't have
> > onBrowserEvent to override. So, how would you do that then?
> >
> > Thanks,
> > Yaakov.
> >
> > On Jul 1, 3:20 am, rudolf michael <[email protected]> wrote:
> >
> >
> >
> > > hello,
> > > you need to override the default behavior of the browser event on the
> > > treeitem
> > > @Override
> > > public void onBrowserEvent(Event event) {
> > > super.onBrowserEvent(event);
> > > if(DOM.eventGetType(event)==Event.ONMOUSEDOWN){
> > > if (DOM.eventGetButton(event) == Event.BUTTON_RIGHT){
> > >               TreeHandler.onRightClick(this);
> > >             }else if (DOM.eventGetButton(event) == Event.BUTTON_LEFT){
> > >               TreeHandler.onLeftClick(this);
> > >             }}else if(DOM.eventGetType(event)==Event.ONMOUSEOVER){
> >
> > >  TreeHandler.onMouseOver(this);}else
> if(DOM.eventGetType(event)==Event.ONMOUSEOUT){
> >
> > > TreeHandler.onMouseOut(this);
> >
> > > }
> > > }
> >
> > > On Thu, Jul 1, 2010 at 8:19 AM, ganesh.shirsat <
> [email protected]>wrote:
> >
> > > > hi,
> >
> > > > How to get TreeItem on right click in GWT 2.0.3
> >
> > > > please help me
> >
> > > > thanks,
> > > > Ganesh Shirsat
> >
> > > > --
> > > > You received this message because you are subscribed to the Google
> Groups
> > > > "Google Web Toolkit" group.
> > > > To post to this group, send email to
> [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<google-web-toolkit%[email protected]><google-web-toolkit%2Bunsubs
> [email protected]>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
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