1
/*******************************************************************************
2
* Copyright (c) 2000, 2008 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
*******************************************************************************/
12
package org.eclipse.cdt.internal.ui.editor;
14
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
15
import org.eclipse.ui.PlatformUI;
16
import org.eclipse.ui.texteditor.ITextEditor;
17
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(ConstructedCEditorMessages.getResourceBundle(), prefix, null);
29
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ICHelpContextIds.GOTO_NEXT_ERROR_ACTION);
31
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ICHelpContextIds.GOTO_PREVIOUS_ERROR_ACTION);
36
CEditor e= (CEditor) getTextEditor();
37
e.gotoAnnotation(fForward);
41
public void setEditor(ITextEditor editor) {
42
if (editor instanceof CEditor)
43
super.setEditor(editor);
48
public void update() {
49
setEnabled(getTextEditor() instanceof CEditor);