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

import com.codenvy.ide.api.ui.action.Action;
import com.codenvy.ide.api.ui.action.ActionEvent;
import com.codenvy.ide.api.ui.workspace.PartStackType;
import com.codenvy.ide.api.ui.workspace.WorkspaceAgent;
import com.google.inject.Inject;

/**
 * Action to launch and show a SQL editor.
 * 
 * @author "Mickaël Leduque"
 */
public class SqlRequestLauncherAction extends Action {

    /** The workspace agent. */
    private final WorkspaceAgent                     workspaceAgent;

    /** The factory to create new SQL editors. */
    private final SqlRequestLauncherPresenterFactory sqlEditorFactory;

    @Inject
    public SqlRequestLauncherAction(final SqlRequestLauncherConstants constants,
                                    final WorkspaceAgent workspaceAgent,
                                    final SqlRequestLauncherPresenterFactory sqlEditorFactory) {
        super(constants.menuEntryOpenSqlEditor());
        this.workspaceAgent = workspaceAgent;
        this.sqlEditorFactory = sqlEditorFactory;
    }

    @Override
    public void actionPerformed(final ActionEvent e) {
        SqlRequestLauncherAdapter requestLauncher = this.sqlEditorFactory.createSqlEditor();
        this.workspaceAgent.openPart(requestLauncher, PartStackType.EDITING);
    }

}

@@ -509,25 +509,16 @@
         
-         
 workspac
@@ -525,16 +525,16 @@
 eAgent;%0A
+
 %0A    /**
@@ -616,33 +616,30 @@
 cher
-PresenterFactory sqlEdito
+Factory requestLaunche
 rFac
@@ -875,33 +875,30 @@
 cher
-PresenterFactory sqlEdito
+Factory requestLaunche
 rFac
@@ -1019,35 +1019,47 @@
 his.
-sqlEditorFactory = sqlEdito
+requestLauncherFactory = requestLaunche
 rFac
@@ -1201,16 +1201,22 @@
 his.
-sqlEdito
+requestLaunche
 rFac
@@ -1229,21 +1229,37 @@
 reateSql
-Edito
+RequestLauncherAdapte
 r();%0A   

Replace use of presenter factory in action with use of launcher facotry