package be.iminds.ilabt.jfed.rspec.model.javafx_impl;

import be.iminds.ilabt.jfed.rspec.model.ExecuteService;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 * User: twalcari
 * Date: 9/10/2014
 * Time: 14:31
 */
public class FXExecuteService implements ExecuteService {
    private final StringProperty shell =  new SimpleStringProperty();
    private final StringProperty command = new SimpleStringProperty();
    private final StringProperty finishedFile = new SimpleStringProperty();

    public FXExecuteService(){

    }

    public FXExecuteService(String shell, String command){
        this.shell.setValue(shell);
        this.command.setValue(command);
    }

    public FXExecuteService(ExecuteService es) {
        this(es.getShell(),es.getCommand());
        this.finishedFile.setValue(es.getFinishedFile());
    }

    @Override
    public String getShell() {
        return shell.get();
    }

    public StringProperty shellProperty() {
        return shell;
    }

    @Override
    public void setShell(String shell) {
        this.shell.set(shell);
    }

    @Override
    public String getCommand() {
        return command.get();
    }

    public StringProperty commandProperty() {
        return command;
    }

    @Override
    public void setCommand(String command) {
        this.command.set(command);
    }

    @Override
    public String getFinishedFile() {
        return finishedFile.get();
    }

    public StringProperty finishedFileProperty() {
        return finishedFile;
    }

    public void setFinishedFile(String finishedFile) {
        this.finishedFile.set(finishedFile);
    }
}
