/*******************************************************************************
 * Copyright (c) 2014-2015 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;

import com.codenvy.ide.Resources;
import com.codenvy.ide.api.parts.WorkspaceAgent;
import com.codenvy.ide.debug.BreakpointManager;
import com.codenvy.ide.jseditor.client.JsEditorConstants;
import com.codenvy.ide.jseditor.client.codeassist.CodeAssistantFactory;
import com.codenvy.ide.jseditor.client.debug.BreakpointRendererFactory;
import com.codenvy.ide.jseditor.client.document.DocumentStorage;
import com.codenvy.ide.jseditor.client.filetype.FileTypeIdentifier;
import com.codenvy.ide.jseditor.client.quickfix.QuickAssistantFactory;
import com.codenvy.ide.jseditor.client.texteditor.EditorModule;
import com.codenvy.ide.jseditor.client.texteditor.EditorWidgetFactory;
import com.codenvy.ide.jseditor.client.texteditor.EmbeddedTextEditorPartView;
import com.codenvy.ide.jseditor.client.texteditor.EmbeddedTextEditorPresenter;
import com.codenvy.ide.ui.dialogs.DialogFactory;
import com.google.inject.assistedinject.Assisted;
import com.google.inject.assistedinject.AssistedInject;
import com.google.web.bindery.event.shared.EventBus;

/**
 * {@link EmbeddedTextEditorPresenter} using codemirror.
 * This class is only defined to allow the Gin binding to be performed.
 */
public class CodeMirrorEditorPresenter extends EmbeddedTextEditorPresenter<CodeMirrorEditorWidget> {

    @AssistedInject
    public CodeMirrorEditorPresenter(final CodeAssistantFactory codeAssistantFactory,
                                     final BreakpointManager breakpointManager,
                                     final BreakpointRendererFactory breakpointRendererFactory,
                                     final DialogFactory dialogFactory,
                                     final DocumentStorage documentStorage,
                                     final JsEditorConstants constant,
                                     @Assisted final EditorWidgetFactory<CodeMirrorEditorWidget> editorWigetFactory,
                                     final EditorModule<CodeMirrorEditorWidget> editorModule,
                                     final EmbeddedTextEditorPartView editorView,
                                     final EventBus eventBus,
                                     final FileTypeIdentifier fileTypeIdentifier,
                                     final QuickAssistantFactory quickAssistantFactory,
                                     final Resources resources,
                                     final WorkspaceAgent workspaceAgent) {
        super(codeAssistantFactory, breakpointManager, breakpointRendererFactory, dialogFactory, documentStorage, constant, editorWigetFactory,
              editorModule, editorView, eventBus, fileTypeIdentifier, quickAssistantFactory, resources, workspaceAgent);
    }



}

@@ -1028,24 +1028,139 @@
 Identifier;%0A
+import com.codenvy.ide.jseditor.client.minimap.HasMinimap;%0Aimport com.codenvy.ide.jseditor.client.minimap.Minimap;%0A
 import com.c
@@ -1282,16 +1282,80 @@
 Module;%0A
+import com.codenvy.ide.jseditor.client.texteditor.EditorWidget;%0A
 import c
@@ -2018,16 +2018,38 @@
 rWidget%3E
+ implements HasMinimap
  %7B%0A%0A    
@@ -3482,12 +3482,333 @@
 %0A    %7D%0A%0A
-%0A
+    @Override%0A    public Minimap getMinimap() %7B%0A        final EditorWidget editorWidget = getEditorWidget();%0A        if (editorWidget instanceof HasMinimap) %7B%0A            return ((HasMinimap)editorWidget).getMinimap();%0A        %7D else %7B%0A            throw new IllegalStateException(%22incorrect editor state%22);%0A        %7D%0A    %7D
 %0A%7D%0A

Add the HasMinimap interface to the editor presenter