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 org.eclipse.ui.help.WorkbenchHelp;
15 import org.eclipse.ui.texteditor.ITextEditor;
16 import org.eclipse.ui.texteditor.TextEditorAction;
18 import net.sourceforge.phpdt.internal.ui.IJavaHelpContextIds;
21 public class GotoAnnotationAction extends TextEditorAction {
23 private boolean fForward;
25 public GotoAnnotationAction(String prefix, boolean forward) {
26 super(PHPEditorMessages.getResourceBundle(), prefix, null);
29 WorkbenchHelp.setHelp(this, IJavaHelpContextIds.GOTO_NEXT_ERROR_ACTION);
31 WorkbenchHelp.setHelp(this, IJavaHelpContextIds.GOTO_PREVIOUS_ERROR_ACTION);
35 PHPEditor e= (PHPEditor) getTextEditor();
36 e.gotoAnnotation(fForward);
39 public void setEditor(ITextEditor editor) {
40 if (editor instanceof PHPEditor)
41 super.setEditor(editor);
45 public void update() {
46 setEnabled(getTextEditor() instanceof PHPEditor);