com.smartgwt.client.widgets.events
Interface HasShowContextMenuHandlers

All Superinterfaces:
HasHandlers
All Known Implementing Classes:
Button, Calendar, Canvas, ColorPicker, ColumnTree, DateChooser, DetailViewer, Dialog, DynamicForm, EdgedCanvas, FilterBuilder, HLayout, HStack, HTMLFlow, HTMLPane, IButton, Img, ImgButton, ImgSectionHeader, ImgSplitbar, ImgTab, Label, Layout, LayoutSpacer, ListGrid, Menu, MenuBar, MenuButton, MultiFilePicker, Progressbar, PropertySheet, RichTextEditor, Scrollbar, SearchForm, SectionHeader, SectionStack, Slider, Snapbar, Splitbar, StatefulCanvas, StretchImg, StretchImgButton, TabSet, TileGrid, TileLayout, Toolbar, ToolStrip, ToolStripResizer, ToolStripSeparator, TreeGrid, ViewLoader, VLayout, VStack, WidgetCanvas, Window

public interface HasShowContextMenuHandlers
extends HasHandlers


Method Summary
 HandlerRegistration addShowContextMenuHandler(ShowContextMenuHandler handler)
          Executed when the right mouse button is clicked.
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Method Detail

addShowContextMenuHandler

HandlerRegistration addShowContextMenuHandler(ShowContextMenuHandler handler)
Executed when the right mouse button is clicked. The default implementation of this method auto-creates a Menu from the contextMenu property on this component and then calls Menu.showContextMenu() on it to show it.

If you want to show a standard context menu, you can simply define your Menu and set it as the contextMenu property on your component - you do not need to override this method.

If you want to do some other processing before showing a menu or do something else entirely, then you should override this method. Note that the return value from this method controls whether or not the native browser context menu is shown.

Parameters:
handler - the showContextMenu handler
Returns:
HandlerRegistration used to remove this handler