1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package net.sourceforge.phpeclipse.phpeditor;
14 import net.sourceforge.phpdt.internal.ui.IJavaHelpContextIds;
16 import org.eclipse.ui.PlatformUI;
17 import org.eclipse.ui.texteditor.ITextEditor;
18 import org.eclipse.ui.texteditor.TextEditorAction;
20 public class GotoAnnotationAction extends TextEditorAction {
22 private boolean fForward;
24 public GotoAnnotationAction(String prefix, boolean forward) {
25 super(PHPEditorMessages.getResourceBundle(), prefix, null);
28 PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
29 IJavaHelpContextIds.GOTO_NEXT_ERROR_ACTION);
31 PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
32 IJavaHelpContextIds.GOTO_PREVIOUS_ERROR_ACTION);
36 PHPEditor e = (PHPEditor) getTextEditor();
37 e.gotoAnnotation(fForward);
40 public void setEditor(ITextEditor editor) {
41 if (editor instanceof PHPEditor)
42 super.setEditor(editor);
46 public void update() {
47 setEnabled(getTextEditor() instanceof PHPEditor);