private void setForceContextMenu ( ) { suppressContextMenu ( getElement ( ) ) ; addShowContextMenuHandler ( new ShowContextMenuHandler ( ) { @ Override public void onShowContextMenu ( ShowContextMenuEvent event ) { getContextMenu ( ) . showContextMenu ( ) ; } } ) ; addListener ( new Listener ( ) { @ Override public void onMouseDown ( ListenerEvent event ) { if ( event . getNativeButton ( ) == NativeEvent . BUTTON_RIGHT ) { Scheduler . get ( ) . scheduleDeferred ( new ScheduledCommand ( ) { @ Override public void execute ( ) { fireEvent ( new ShowContextMenuEvent ( getOrCreateJsObj ( ) ) ) ; } } ) ; } } @ Override public void onMouseUp ( ListenerEvent event ) { } @ Override public void onMouseMove ( ListenerEvent event ) { } @ Override public void onMouseOut ( ListenerEvent event ) { } @ Override public void onMouseOver ( ListenerEvent event ) { } @ Override public void onMouseWheel ( ListenerEvent event ) { } } ) ; }
IE11 fix to force context !!!