Subclass the CompositeCell class, override the
getConsumedEvents(),onBrowserEvent() methods.  In getConsumedEvents
method  should return Collections.singleton("contextmenu").  Call the
preventDefault(),stopPropagation() methods inside the onBrowserEvent()
method.  Try the below code.

S. Abraham
www.DataStoreGwt.com
Persist objects directly in Google App Engine

//In client side

public Cell getYourCell()
  {
    final List hasCellAL = new ArrayList();
    hasCellAL.add(TextInputCell());

   class SampleCompositeCell extends CompositeCell
   {
       public SampleCompositeCell (List<HasCell> hasCelList)
       {
        super(hasCelList);
       }

      @Override
      public Set getConsumedEvents()
      {
        printNative(" getConsumedEvents() called ");
        return Collections.singleton("contextmenu");
      }

      @Override
      public void onBrowserEvent(Context context, Element parent,
Object value, NativeEvent event, ValueUpdater valueUpdater)
      {
        event.preventDefault();
        event.stopPropagation();
        printNative(" right click NativeEvent " + event);
        printNative(" holder object  " + value);
      }

   }
    return new SampleCompositeCell (hasCellAL);
  }

//add your cell in cellList
    CellList<String> cellList = new CellList<String>(getYourCell());
 
cellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);


-- 
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