Révision 814
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 814) | ||
---|---|---|
952 | 952 |
*/ |
953 | 953 |
public static Menu initContextMenu(Composite composite, String menuId, IWorkbenchPartSite partSite, ISelectionProvider selectionProvider) { |
954 | 954 |
MenuManager menuManager = new MenuManager(menuId, menuId); |
955 |
//duplicate with registerContextMenu() |
|
956 |
//IMenuService menuService = (IMenuService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IMenuService.class); |
|
957 |
//menuService.populateContributionManager(menuManager, "popup:" + menuId); //$NON-NLS-1$ |
|
955 |
|
|
958 | 956 |
Menu menu = menuManager.createContextMenu(composite); |
959 | 957 |
composite.setMenu(menu); |
960 | 958 |
|
961 | 959 |
if(partSite != null && selectionProvider != null) { |
962 | 960 |
partSite.registerContextMenu(menuManager, selectionProvider); |
963 | 961 |
} |
962 |
else { |
|
963 |
IMenuService menuService = (IMenuService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IMenuService.class); |
|
964 |
menuService.populateContributionManager(menuManager, "popup:" + menuId); //$NON-NLS-1$ |
|
965 |
} |
|
964 | 966 |
|
965 | 967 |
menuManager.update(true); |
966 | 968 |
return menu; |
Formats disponibles : Unified diff