File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes GWT and the fly likes GWT:Unable to detect right clicks on customized tab panel. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "GWT:Unable to detect right clicks on customized tab panel." Watch "GWT:Unable to detect right clicks on customized tab panel." New topic
Author

GWT:Unable to detect right clicks on customized tab panel.

Pradeep Mudaliar
Greenhorn

Joined: Oct 11, 2007
Posts: 23
Hi all,

I am working on a customized tab panel widget which is extending the
TabPanel class in Google Web Toolkit. One of the requirements is that right clicks on the
tabs should be detected so that i could display my own customized
context menu. But, i am not able to detect the right clicks on the tab
panels. Heres a summary of the steps i have taken:


1. In the default constructor for the TabPanelModified class, I am
sinking the "on mouse down" event using
this.sinkEvents(Event.ONMOUSEDOWN).
2. I have also disabled the default context menu provided by the
browser using the method "disableContextMenu", in the default
constructor itself. The definition for this particular method is as
follows:


public static native void disableContextMenu(Element e) /*-{
e.oncontextmenu = function() { return false; };
}-*/;


3. I have then overridden the method "onBrowserEvent" which is used
for detecting Event.ONMOUSEDOWN and Event.BUTTON_RIGHT. Once they get
detected, I am trying to display the customized context menu.


I would be obliged if anyone here can point out the mistake in the
above steps. I would also like to know if there is any other way to do
the same task.


SCJP 6 - 80%
My Blog - http://www.polymorphiccoder.blogspot.com
Pradeep Mudaliar
Greenhorn

Joined: Oct 11, 2007
Posts: 23
Is there no one here with a solution or have I posted the query in a wrong section?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

I do not believe that there are many fans of GWT that regularly visit this forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

I suggest you participate in GWT official group, the people there are so helpful and experts.
http://groups.google.com/group/Google-Web-Toolkit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GWT:Unable to detect right clicks on customized tab panel.