/*******************************************************************************
* Copyright (c) 2009, 2010 Innovation Gate GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Innovation Gate GmbH - initial API and implementation
******************************************************************************/
package de.innovationgate.eclipse.editors.tmlscript;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.ui.menus.CommandContributionItem;
import org.eclipse.ui.menus.CommandContributionItemParameter;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import de.innovationgate.eclipse.editors.actions.SurroundWithAction;
import de.innovationgate.eclipse.editors.all.AbstractWGATextEditor;
import de.innovationgate.eclipse.editors.commands.ToggleComment;
public class TMLScriptEditor extends AbstractWGATextEditor {
public TMLScriptEditor() {
super();
setSourceViewerConfiguration(new TMLScriptEditorConfiguration());
setDocumentProvider(new TMLScriptDocumentProvider());
}
@Override
protected void editorContextMenuAboutToShow(IMenuManager menu) {
super.editorContextMenuAboutToShow(menu);
menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new CommandContributionItem(new CommandContributionItemParameter(getSite(), null, ToggleComment.ID, null, null, null, null, "Toggle comment", null, null, CommandContributionItem.STYLE_PUSH, null, true)));
menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new SurroundWithAction());
}
@Override
protected void createActions() {
super.createActions();
setAction(SurroundWithAction.ID, new SurroundWithAction());
}
@Override
protected String[] getKeyBindingScopes() {
return new String[] { "de.innovationgate.eclipse.ids.contexts.TMLScriptEditorContext" };
}
}