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;
21 public class GotoAnnotationAction extends TextEditorAction {
23 private boolean fForward;
25 public GotoAnnotationAction(String prefix, boolean forward) {
26 super(PHPEditorMessages.getResourceBundle(), prefix, null);
29 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.GOTO_NEXT_ERROR_ACTION);
31 PlatformUI.getWorkbench().getHelpSystem().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);