eclipse plugin: override the default editorcallback...

...so we have full control of when we add xtext nature
This commit is contained in:
Timotei Dolean 2010-08-07 18:28:14 +00:00
parent 04bd0e1686
commit b2c221c71b
2 changed files with 29 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.xtext.resource.ILocationInFileProvider;
import org.eclipse.xtext.ui.editor.IXtextEditorCallback;
import org.eclipse.xtext.ui.editor.XtextEditor;
import org.eclipse.xtext.ui.editor.autoedit.DefaultAutoEditStrategy;
import org.eclipse.xtext.ui.editor.bracketmatching.IBracketMatcher;
@ -25,6 +26,7 @@ import org.eclipse.xtext.ui.editor.syntaxcoloring.ISemanticHighlightingCalculato
import org.eclipse.xtext.ui.editor.syntaxcoloring.antlr.AbstractAntlrTokenToAttributeIdMapper;
import org.wesnoth.ui.autoedit.WMLAutoEditStrategy;
import org.wesnoth.ui.contentassist.WMLContentAssistContext;
import org.wesnoth.ui.editor.WMLAbstractDirtyEditorCallback;
import org.wesnoth.ui.editor.WMLEditor;
import org.wesnoth.ui.labeling.WMLLabelProvider;
import org.wesnoth.ui.navigation.WMLHyperlinkHelper;
@ -130,4 +132,10 @@ public class WMLUiModule extends org.wesnoth.ui.AbstractWMLUiModule
{
return WMLLabelProvider.class;
}
@Override
public Class<? extends IXtextEditorCallback> bindIXtextEditorCallback()
{
return WMLAbstractDirtyEditorCallback.class;
}
}

View File

@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2010 by Timotei Dolean <timotei21@gmail.com>
*
* 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
*******************************************************************************/
package org.wesnoth.ui.editor;
import org.eclipse.xtext.ui.editor.AbstractDirtyStateAwareEditorCallback;
import org.eclipse.xtext.ui.editor.XtextEditor;
public class WMLAbstractDirtyEditorCallback extends AbstractDirtyStateAwareEditorCallback
{
@Override
public void afterCreatePartControl(XtextEditor editor)
{
super.afterCreatePartControl(editor);
}
}