IWorkbenchPart part= JavaPlugin.getActivePage().getActivePart(); IWorkbenchPartSite site= part.getSite(); fKeyBindingService=  site.getKeyBindingService();   fKeyBindingScopes= fKeyBindingService.getScopes();    IWorkbench workbench= PlatformUI.getWorkbench(); workbench.getContextSupport().registerShell(fShell, IWorkbenchContextSupport.TYPE_WINDOW | IWorkbenchContextSupport.TYPE_DIALOG);   fShowViewMenuAction= new Action("showViewMenu") {  public void run() { showViewMenu(); } }; fShowViewMenuAction.setActionDefinitionId("org.eclipse.ui.window.showViewMenu"); fKeyBindingService.registerAction(fShowViewMenuAction);
	private void createViewMenu(Composite toolbar) {		fToolBar= new ToolBar(toolbar, SWT.FLAT);		ToolItem viewMenuButton= new ToolItem(fToolBar, SWT.PUSH, 0);				GridData data= new GridData();		data.horizontalAlignment= GridData.END;		data.verticalAlignment= GridData.BEGINNING;		fToolBar.setLayoutData(data);		Image hoverImage= JavaPluginImages.get(JavaPluginImages.IMG_VIEW_MENU);		viewMenuButton.setImage(hoverImage);		viewMenuButton.setToolTipText(TextMessages.getString("AbstractInformationControl.viewMenu.toolTipText")); //$NON-NLS-1$		viewMenuButton.addSelectionListener(new SelectionAdapter() {			public void widgetSelected(SelectionEvent e) {				showViewMenu();			}		});				// Key binding service		IWorkbenchPart part= JavaPlugin.getActivePage().getActivePart();		IWorkbenchPartSite site= part.getSite();		fKeyBindingService=  site.getKeyBindingService();		// Remember current scope and then remove it.		fKeyBindingScopes= fKeyBindingService.getScopes();//		fKeyBindingService.setScopes(new String[] {});				// Register shell with key binding support		IWorkbench workbench= PlatformUI.getWorkbench();		workbench.getContextSupport().registerShell(fShell, IWorkbenchContextSupport.TYPE_WINDOW | IWorkbenchContextSupport.TYPE_DIALOG);				// Register action with key binding service		fShowViewMenuAction= new Action("showViewMenu") { //$NON-NLS-1$			/*			 * @see org.eclipse.jface.action.Action#run()			 */			public void run() {				showViewMenu();			}		};		fShowViewMenuAction.setActionDefinitionId("org.eclipse.ui.window.showViewMenu"); //$NON-NLS-1$		fKeyBindingService.registerAction(fShowViewMenuAction);	}