1 /*******************************************************************************
2 * Copyright (c) 2009, 2011 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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.ui.actions;
13 import org.eclipse.jface.viewers.IStructuredSelection;
15 import org.eclipse.jface.text.ITextSelection;
17 import org.eclipse.ui.IWorkbenchSite;
18 import org.eclipse.ui.PlatformUI;
20 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
21 import org.eclipse.jdt.internal.ui.actions.ActionMessages;
22 import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
26 * The action allows to open the implementation for a method in its hierarchy.
28 * The action is applicable to selections containing elements of type <code>
33 * @noextend This class is not intended to be subclassed by clients.
35 public class OpenImplementationAction extends SelectionDispatchAction {
40 public JavaEditor fEditor;
44 * Creates an <code>OpenImplementationAction</code>.
46 * @param site the workbench site
48 protected OpenImplementationAction(IWorkbenchSite site) {
50 setText(ActionMessages.OpenImplementationAction_label);
51 setDescription(ActionMessages.OpenImplementationAction_description);
52 setToolTipText(ActionMessages.OpenImplementationAction_tooltip);
53 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_IMPLEMENTATION_ACTION);
57 * Creates an <code>OpenImplementationAction</code>. Note: This constructor is for internal use
58 * only. Clients should not call this constructor.
60 * @param editor the editor
61 * @noreference This constructor is not intended to be referenced by clients.
63 public OpenImplementationAction(JavaEditor editor) {
64 this(editor.getEditorSite());
66 fEditor.generated_2044915647447833346(this);
70 * @see org.eclipse.jdt.ui.actions.SelectionDispatchAction#selectionChanged(org.eclipse.jface.text.ITextSelection)
73 public void selectionChanged(ITextSelection selection) {
77 * @see org.eclipse.jdt.ui.actions.SelectionDispatchAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
80 public void selectionChanged(IStructuredSelection selection) {
85 * @see org.eclipse.jdt.ui.actions.SelectionDispatchAction#run(org.eclipse.jface.text.ITextSelection)
88 public void run(ITextSelection selection) {
89 fEditor.generated_4148697551160775241(this, selection);
94 * Returns the dialog title.
96 * @return the dialog title
98 public String getDialogTitle() {
99 return ActionMessages.OpenImplementationAction_error_title;