package com.codenvy.ide.ext.datasource.client.sqllauncher;

import com.codenvy.ide.api.editor.EditorPartPresenter;
import com.codenvy.ide.api.editor.EditorProvider;
import com.codenvy.ide.api.notification.NotificationManager;
import com.codenvy.ide.api.preferences.PreferencesManager;
import com.codenvy.ide.dto.DtoFactory;
import com.codenvy.ide.ext.datasource.client.DatasourceClientService;
import com.codenvy.ide.ext.datasource.client.DatasourceManager;
import com.codenvy.ide.ext.datasource.client.sqleditor.SqlEditorProvider;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;

public class SqlLauncherEditorProvider implements EditorProvider {

    private final NotificationManager   notificationManager;

    private final SqlEditorProvider     sqlEditorProvider;

    private SqlRequestLauncherConstants constants;

    private PreferencesManager          preferencesManager;

    private DatasourceManager           datasourceManager;

    private EventBus                    eventBus;

    private DatasourceClientService     service;

    private DtoFactory                  dtoFactory;

    private SqlRequestLauncherFactory   sqlRequestLauncherFactory;


    @Inject
    public SqlLauncherEditorProvider(final NotificationManager notificationManager,
                                     final SqlEditorProvider sqlEditorProvider,
                                     final SqlRequestLauncherConstants constants,
                                     final PreferencesManager preferencesManager,
                                     final DatasourceManager datasourceManager,
                                     final EventBus eventBus,
                                     final DatasourceClientService service,
                                     final DtoFactory dtoFactory,
                                     final SqlRequestLauncherFactory sqlRequestLauncherFactory) {
        this.notificationManager = notificationManager;
        this.sqlEditorProvider = sqlEditorProvider;
        this.constants = constants;
        this.preferencesManager = preferencesManager;
        this.datasourceManager = datasourceManager;
        this.eventBus = eventBus;
        this.service = service;
        this.dtoFactory = dtoFactory;
        this.sqlRequestLauncherFactory = sqlRequestLauncherFactory;
    }

    @Override
    public EditorPartPresenter getEditor() {
        return new SqlRequestLauncherAdapter(sqlRequestLauncherFactory.createSqlRequestLauncherView(),
                                             constants,
                                             preferencesManager,
                                             sqlEditorProvider,
                                             service,
                                             notificationManager,
                                             datasourceManager,
                                             eventBus,
                                             dtoFactory);

    }
}

@@ -185,995 +185,164 @@
 ide.
-api.notification.NotificationManager;%0Aimport com.codenvy.ide.api.preferences.PreferencesManager;%0Aimport com.codenvy.ide.dto.DtoFactory;%0Aimport com.codenvy.ide.ext.datasource.client.DatasourceClientService;%0Aimport com.codenvy.ide.ext.datasource.client.DatasourceManager;%0Aimport com.codenvy.ide.ext.datasource.client.sqleditor.SqlEditorProvider;%0Aimport com.google.inject.Inject;%0Aimport com.google.web.bindery.event.shared.EventBus;%0A%0Apublic class SqlLauncherEditorProvider implements EditorProvider %7B%0A%0A    private final NotificationManager   notificationManager;%0A%0A    private final SqlEditorProvider     sqlEditorProvider;%0A%0A    private SqlRequestLauncherConstants constants;%0A%0A    private PreferencesManager          preferencesManager;%0A%0A    private DatasourceManager           datasourceManager;%0A%0A    private EventBus                    eventBus;%0A%0A    private DatasourceClientService     service;%0A%0A    private DtoFactory                  dtoFactory;%0A%0A    private SqlRequestLauncherFactory  
+util.loging.Log;%0Aimport com.google.inject.Inject;%0A%0Apublic class SqlLauncherEditorProvider implements EditorProvider %7B%0A%0A    private SqlRequestLauncherFactory
  sql
@@ -366,17 +366,16 @@
 ctory;%0A%0A
-%0A
     @Inj
@@ -425,621 +425,77 @@
 nal 
-NotificationManager notificationManager,%0A                                     final SqlEditorProvider sqlEditorProvider,%0A                                     final SqlRequestLauncherConstants constants,%0A                                     final PreferencesManager preferencesManager,%0A                                     final DatasourceManager datasourceManager,%0A                                     final EventBus eventBus,%0A                                     final DatasourceClientService service,%0A                                     final DtoFactory dtoFactory,%0A                                     final S
+SqlRequestLauncherFactory sqlRequestLauncherFactory) %7B%0A        this.s
 qlRe
@@ -506,32 +506,34 @@
 tLauncherFactory
+ =
  sqlRequestLaunc
@@ -546,1086 +546,255 @@
 tory
-) %7B
+;
 %0A    
+%7D%0A%0A
     
-this.notificationManager = notificationManager;%0A        this.sqlEditorProvider = sqlEditorProvider;%0A        this.constants = constants;%0A        this.preferencesManager = preferencesManager;%0A        this.datasourceManager = datasourceManager;%0A        this.eventBus = eventBus;%0A        this.service = service;%0A        this.dtoFactory = dtoFactory;%0A        this.sqlRequestLauncherFactory = sqlRequestLauncherFactory;%0A    %7D%0A%0A    @Override%0A    public EditorPartPresenter getEditor() %7B%0A        return new SqlRequestLauncherAdapter(sqlRequestLauncherFactory.createSqlRequestLauncherView(),%0A                                             constants,%0A                                             preferencesManager,%0A                                             sqlEditorProvider,%0A                                             service,%0A                                             notificationManager,%0A                                             datasourceManager,%0A                                             eventBus,%0A                                             dtoFactory
+@Override%0A    public EditorPartPresenter getEditor() %7B%0A        Log.info(SqlLauncherEditorProvider.class, %22New instance of SQL launcher editor requested.%22);%0A        return sqlRequestLauncherFactory.createSqlRequestLauncherPresenter(
 );%0A
-%0A
     

Simplify the SQL launcher editor provider