/*
 * Copyright (c) 2016-2017 PST (http://istc.cnr.it/group/pst).
 * 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:
 *   Giulio Bernardi
 */
package it.cnr.istc.keen.fbt.launchers;

import java.io.IOException;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.ui.console.IOConsole;

import it.cnr.istc.keen.epsl.launchers.BaseEpslProcessMonitor;

public class FbtExecProcessMonitor extends BaseEpslProcessMonitor
{
    protected String initCmd;
    protected String execArgs;
	
	public FbtExecProcessMonitor(String ddlFile, String pdlFile, String planArgs, boolean doExit, String exportFile,
			IStreamsProxy sp, IOConsole iocon, IProgressMonitor monitor, IProcess process) {
		super(ddlFile, pdlFile, planArgs, doExit, exportFile, sp, iocon, monitor, process);
	}

	@Override
    protected String getPrompt()
    {
    	return "FbT$";
    }

	@Override
    protected void initArgs(String ddlFile, String pdlFile, String planArgs, boolean doExit,
    		String exportFile, IStreamsProxy sp, IProgressMonitor monitor, IProcess process)
    {
        this.sp = sp;
        this.monitor = monitor;
        this.execArgs = String.format("%s%n",planArgs);
        this.process = process;
        initCmd = String.format("set-preference %s%n", ddlFile);
    }
	
	@Override	
    protected void beforeThreadStart(Thread t)
    {
		ProcessMonitorRegistry.addMonitor(process, this);
    }
    
	@Override
    protected void sendCommands() throws IOException
    {
		if (true == false)
		{
        waitPrompt();
        con.write(initCmd);

        if (monitor.isCanceled())
            return;
		}

        waitPrompt();
        con.write(execArgs);

        if (monitor.isCanceled())
            return;

        monitor.worked(1);
    }
}

@@ -644,40 +644,142 @@
 psl.
-launchers.BaseEpslProcessMonitor
+ConfigurationData;%0Aimport it.cnr.istc.keen.epsl.launchers.BaseEpslProcessMonitor;%0Aimport it.cnr.istc.keen.fbt.FbtExecConfigurationData
 ;%0A%0Ap
@@ -2157,11 +2157,129 @@
 );%0A    %7D
+%0A%0A%09@Override%0A%09protected ConfigurationData getConfigurationData() %7B%0A%09%09return FbtExecConfigurationData.getInstance();%0A%09%7D
 %0A%7D%0A

Fix typo and missing method (fbt executor)