Elexis API documentation
Version 2.1.6 as of December 11 2011

de.ralfebert.rcputils.menus
Class ContextMenu

java.lang.Object
  extended by de.ralfebert.rcputils.menus.ContextMenu

public class ContextMenu
extends java.lang.Object

ContextMenu creates a context menu for a structured viewer and registers it with the workbench. It can assist with handling the default menu item.

Author:
Ralf Ebert
See Also:
http://www.ralfebert.de/blog/eclipsercp/commands_context_menu/

Constructor Summary
ContextMenu(StructuredViewer viewer, IWorkbenchPartSite site)
          Creates an empty context menu for a structured viewer and registers it for the given workbench part site.
ContextMenu(StructuredViewer viewer, IWorkbenchPartSite site, boolean defaultItemHandling)
          Deprecated. 
 
Method Summary
 void setDefaultItemHandling(boolean defaultItemHandling)
          Activates default item handling.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextMenu

public ContextMenu(StructuredViewer viewer,
                   IWorkbenchPartSite site)
Creates an empty context menu for a structured viewer and registers it for the given workbench part site. The created menu is intended to be filled using contributions to "org.eclipse.ui.menus" with locationURI "popup:". If defaultItemHandling = true,


ContextMenu

@Deprecated
public ContextMenu(StructuredViewer viewer,
                              IWorkbenchPartSite site,
                              boolean defaultItemHandling)
Deprecated. 

Method Detail

setDefaultItemHandling

public void setDefaultItemHandling(boolean defaultItemHandling)
Activates default item handling. When set to true, the menu is extended so that the first command contribution whose contribution id ends with ".default" is set as default item for the menu. The double click event is handled by executing the default command.


Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis