/*******************************************************************************
 * Copyright (c) 2014 Codenvy, S.A.
 * 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:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/
package com.codenvy.ide.editor.codemirror.client.inject;

import com.codenvy.ide.api.extension.ExtensionGinModule;
import com.codenvy.ide.editor.codemirror.client.CodeMirrorEditorWidget;
import com.codenvy.ide.jseditor.client.texteditor.EditorWidgetFactory;
import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.inject.client.assistedinject.GinFactoryModuleBuilder;
import com.google.inject.TypeLiteral;

@ExtensionGinModule
public class CodeMirrorEditorGinModule extends AbstractGinModule {

    @Override
    protected void configure() {
        // Bind the CodeMirror EditorWidget factory
        install(new GinFactoryModuleBuilder().build(new TypeLiteral<EditorWidgetFactory<CodeMirrorEditorWidget>>() {
        }));
    }
}

@@ -568,16 +568,44 @@
 nject;%0A%0A
+import javax.inject.Named;%0A%0A
 import c
@@ -645,32 +645,107 @@
 nsionGinModule;%0A
+import com.codenvy.ide.editor.codemirror.client.CodeMirrorEditorExtension;%0A
 import com.coden
@@ -1002,16 +1002,87 @@
 uilder;%0A
+import com.google.inject.Provides;%0Aimport com.google.inject.Singleton;%0A
 import c
@@ -1412,24 +1412,24 @@
 idget%3E%3E() %7B%0A
-
         %7D));
@@ -1434,11 +1434,189 @@
 );%0A    %7D
+%0A%0A    @Provides%0A    @Singleton%0A    @Named(%22DefaultEditorType%22)%0A    protected String defaultEditorTypeKey() %7B%0A        return CodeMirrorEditorExtension.CODEMIRROR_EDITOR_KEY;%0A    %7D
 %0A%7D%0A

Declare the default editor