package be.iminds.ilabt.jfed.experimenter_gui.slice.progress;

import be.iminds.ilabt.jfed.experimenter_gui.ui.status.TaskStatusIndicator;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.event.Event;
import javafx.event.EventHandler;

/**
 * User: twalcari
 * Date: 11/27/13
 * Time: 11:41 AM
 */
public class ProgressItem {
    private final ObjectProperty<TaskStatusIndicator.Status> progress = new SimpleObjectProperty<>();
    private final StringProperty text = new SimpleStringProperty();
    private final StringProperty status = new SimpleStringProperty();
    private final ObjectProperty<EventHandler<Event>> onDetailsView = new SimpleObjectProperty<>();


    public ProgressItem(String text, TaskStatusIndicator.Status progress) {
        this.text.set(text);
        this.progress.set(progress);
    }

    public ProgressItem(String text) {
        this(text, TaskStatusIndicator.Status.INACTIVE);
    }

    public ProgressItem() {
        this("");
    }

    public TaskStatusIndicator.Status getProgress() {
        return progress.get();
    }

    public ObjectProperty<TaskStatusIndicator.Status> progressProperty() {
        return progress;
    }

    public String getText() {
        return text.get();
    }

    public StringProperty textProperty() {
        return text;
    }

    public void setProgress(TaskStatusIndicator.Status progress) {
        this.progress.set(progress);
    }

    public void setText(String text) {
        this.text.set(text);
    }

    public EventHandler<Event> getOnDetailsView() {
        return onDetailsView.get();
    }

    public ObjectProperty<EventHandler<Event>> onDetailsViewProperty() {
        return onDetailsView;
    }

    public void setOnDetailsView(EventHandler<Event> onDetailsView) {
        this.onDetailsView.set(onDetailsView);
    }

    public String getStatus() {
        return status.get();
    }

    public StringProperty statusProperty() {
        return status;
    }

    public void setStatus(String status) {
        this.status.set(status);
    }
}
