Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

ch.elexis.util
Class ViewMenus

java.lang.Object
  extended by ch.elexis.util.ViewMenus

public class ViewMenus
extends java.lang.Object

This class simplifies the handling of menus and toolbars.


Nested Class Summary
static interface ViewMenus.IMenuPopulator
           
 
Constructor Summary
ViewMenus(org.eclipse.ui.IViewSite s)
           
 
Method Summary
 void createControlContextMenu(org.eclipse.swt.widgets.Control control, org.eclipse.jface.action.IAction... actions)
          Creates a menu for the given control containing the given actions
 void createControlContextMenu(org.eclipse.swt.widgets.Control control, ViewMenus.IMenuPopulator populator)
          Creates a menu for the given Control that will be populated by the provided populator This can be used to construct dynamic menus that change contents depending of state.
 void createMenu(org.eclipse.jface.action.IAction... actions)
          Create a menu containing the specified actions.
 void createToolbar(org.eclipse.jface.action.IAction... actions)
          Create a toolbar containing the specified actions
 void createViewerContextMenu(org.eclipse.jface.viewers.StructuredViewer viewer, org.eclipse.jface.action.IAction... actions)
          Attach a context menu to a org.eclipse.jface.StructuredViewer
protected  void fillContextMenu(org.eclipse.jface.action.IMenuManager manager, org.eclipse.jface.action.IAction... actions)
           
 org.eclipse.jface.action.MenuManager getContextMenu()
          Return the context menu for registration with the selectionProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewMenus

public ViewMenus(org.eclipse.ui.IViewSite s)
Method Detail

createMenu

public void createMenu(org.eclipse.jface.action.IAction... actions)
Create a menu containing the specified actions.

Parameters:
actions - a collection of actions and null-values (that represent separators)

createToolbar

public void createToolbar(org.eclipse.jface.action.IAction... actions)
Create a toolbar containing the specified actions

Parameters:
actions - a collection of actions and null-values (that represent separators)

createViewerContextMenu

public void createViewerContextMenu(org.eclipse.jface.viewers.StructuredViewer viewer,
                                    org.eclipse.jface.action.IAction... actions)
Attach a context menu to a org.eclipse.jface.StructuredViewer

Parameters:
viewer - the viewer
actions - the actions to use

createControlContextMenu

public void createControlContextMenu(org.eclipse.swt.widgets.Control control,
                                     org.eclipse.jface.action.IAction... actions)
Creates a menu for the given control containing the given actions

Parameters:
control - the Control to add the menu to
actions - the actions to be shown in the menu

getContextMenu

public org.eclipse.jface.action.MenuManager getContextMenu()
Return the context menu for registration with the selectionProvider

Returns:
MenuManager for the contextMenu

createControlContextMenu

public void createControlContextMenu(org.eclipse.swt.widgets.Control control,
                                     ViewMenus.IMenuPopulator populator)
Creates a menu for the given Control that will be populated by the provided populator This can be used to construct dynamic menus that change contents depending of state.


fillContextMenu

protected void fillContextMenu(org.eclipse.jface.action.IMenuManager manager,
                               org.eclipse.jface.action.IAction... actions)

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013