KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > handlers > ShowKeyAssistHandler


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.internal.handlers;
13
14 import org.eclipse.core.commands.ExecutionEvent;
15 import org.eclipse.ui.IWorkbench;
16 import org.eclipse.ui.PlatformUI;
17 import org.eclipse.ui.keys.IBindingService;
18
19 /**
20  * A handler that displays the key assist dialog when executed.
21  *
22  * @since 3.1
23  */

24 public class ShowKeyAssistHandler extends WorkbenchWindowHandlerDelegate {
25
26     /**
27      * Opens the key assistant. This should never be called until initialization
28      * occurs.
29      *
30      * @param event
31      * Ignored
32      * @return <code>null</code>
33      */

34     public Object JavaDoc execute(final ExecutionEvent event) {
35         final IWorkbench workbench = PlatformUI.getWorkbench();
36         final IBindingService bindingService = (IBindingService) workbench.getService(IBindingService.class);
37         bindingService.openKeyAssistDialog();
38         return null;
39     }
40 }
41
Popular Tags