package com.googlecode.goclipse.editors;

import org.eclipse.jface.action.IAction;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ide.IDEActionFactory;
import org.eclipse.ui.texteditor.BasicTextEditorActionContributor;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;

public class GoEditorActionContributor extends BasicTextEditorActionContributor {

  public GoEditorActionContributor() {

  }

  @Override
  public void setActiveEditor(IEditorPart part) {
    super.setActiveEditor(part);

    ITextEditor textEditor = null;

    if (part instanceof ITextEditor) {
      textEditor = (ITextEditor) part;
    }

    IActionBars bars = getActionBars();

    bars.setGlobalActionHandler("com.googlecode.goclipse.actions.ToggleComment",
        getAction(textEditor, "ToggleComment"));

    bars.setGlobalActionHandler("com.googlecode.goclipse.actions.ShiftRight",
        getAction(textEditor, "ShiftRight"));
    bars.setGlobalActionHandler("com.googlecode.goclipse.actions.ShiftLeft",
        getAction(textEditor, "ShiftLeft"));

    bars.setGlobalActionHandler(IDEActionFactory.OPEN_PROJECT.getId(),
        getAction(textEditor, IDEActionFactory.OPEN_PROJECT.getId()));
    bars.setGlobalActionHandler(IDEActionFactory.CLOSE_PROJECT.getId(),
        getAction(textEditor, IDEActionFactory.CLOSE_PROJECT.getId()));

    IAction action = getAction(textEditor, ITextEditorActionConstants.REFRESH);
    bars.setGlobalActionHandler(ITextEditorActionConstants.REFRESH, action);
  }

}

@@ -227,147 +227,9 @@
 tor.
-BasicTextEditorActionContributor;%0Aimport org.eclipse.ui.texteditor.ITextEditor;%0Aimport org.eclipse.ui.texteditor.ITextEditorActionConstants
+*
 ;%0A%0Ap
@@ -1434,16 +1434,501 @@
 action);
+%0A%0A    action= getAction(textEditor, ITextEditorActionConstants.NEXT);%0A    bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, action);%0A    bars.setGlobalActionHandler(ITextEditorActionConstants.NEXT, action);%0A    action= getAction(textEditor, ITextEditorActionConstants.PREVIOUS);%0A    bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, action);%0A    bars.setGlobalActionHandler(ITextEditorActionConstants.PREVIOUS, action);
 %0A  %7D%0A%0A%7D%0A

add next/prev actions