/*
 * generated by Xtext
 */
package net.sourceforge.ufoai.ui;

import net.sourceforge.ufoai.ui.folding.FoldingRegionProvider;
import net.sourceforge.ufoai.ui.hover.HoverProvider;
import net.sourceforge.ufoai.ui.properties.UFOScriptPropertyViewer;
import net.sourceforge.ufoai.ui.syntaxcoloring.HighlightingConfiguration;
import net.sourceforge.ufoai.ui.syntaxcoloring.SemanticHighlightingCalculator;
import net.sourceforge.ufoai.ui.tasks.ITaskElementChecker;
import net.sourceforge.ufoai.ui.tasks.TaskConstants;
import net.sourceforge.ufoai.ui.tasks.UFOScriptTaskElementChecker;
import net.sourceforge.ufoai.ui.tasks.XtextTaskCalculator;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.xtext.ui.editor.IXtextEditorCallback;
import org.eclipse.xtext.ui.editor.XtextEditor;
import org.eclipse.xtext.ui.editor.contentassist.XtextContentAssistProcessor;
import org.eclipse.xtext.ui.editor.folding.DefaultFoldingRegionProvider;
import org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider;
import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfiguration;
import org.eclipse.xtext.ui.editor.syntaxcoloring.ISemanticHighlightingCalculator;

import com.google.inject.Binder;
import com.google.inject.name.Named;
import com.google.inject.name.Names;

/**
 * Use this class to register components to be used within the IDE.
 */
public class UFOScriptUiModule extends net.sourceforge.ufoai.ui.AbstractUFOScriptUiModule {
	public UFOScriptUiModule(AbstractUIPlugin plugin) {
		super(plugin);
	}

	@Override
	public void configure(Binder binder) {
		super.configure(binder);
		Named named = com.google.inject.name.Names.named(XtextContentAssistProcessor.COMPLETION_AUTO_ACTIVATION_CHARS);
		binder.bind(String.class).annotatedWith(named).toInstance(".,:");
		binder.bind(IEObjectHoverProvider.class).to(HoverProvider.class);
	}

	public Class<? extends XtextEditor> bindEditor() {
		return UFOScriptPropertyViewer.class;
	}

	public Class<? extends ISemanticHighlightingCalculator> bindSemanticHighlightingCalculator() {
		return SemanticHighlightingCalculator.class;
	}

	public Class<? extends IHighlightingConfiguration> bindIHighlightingConfiguration() {
		return HighlightingConfiguration.class;
	}

	public Class<? extends DefaultFoldingRegionProvider> bindDefaultFoldingRegionProvider() {
		return FoldingRegionProvider.class;
	}

	public void configureMatchingTagMarker(com.google.inject.Binder binder) {
		binder.bind(IXtextEditorCallback.class).annotatedWith(Names.named(TaskConstants.XTEXT_TASKS)).to( //$NON-NLS-1$
				XtextTaskCalculator.class);
	}

	public Class<? extends ITaskElementChecker> bindTaskElementChecker() {
		return UFOScriptTaskElementChecker.class;
	}
}
