package be.iminds.ilabt.jfed.experimenter_gui.tutorials;

import be.iminds.ilabt.jfed.ui.javafx.util.StageUtils;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.mockito.Mockito;

import java.net.URL;
import java.util.Collections;

/**
 * User: twalcari
 * Date: 3/22/2016
 * Time: 11:39
 */
public class TutorialDescriptionViewTest extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {

        Tutorial tut = new Tutorial();
        tut.setTitle("Test tutorial");
        tut.setImage(new URL("https://avatars1.githubusercontent.com/u/1507452?v=3&amp;s=400"));
        tut.setDescription("Lorem ipsum indurain bidon liquigas vendee battoowoo greekgreek, rouleur derby is for lovers gilbert gavia liquigas nokere koerse? Maillot jaune flamme rouge, the planckaert kelly e3 prijs vlaanderen nevele jens, col du galibier gaul pyrenees hinault? Muur bosberg ronde van belgie, on your left bonk soigneur driedaagse de panne-koksijde tati ombregt, gruppetto kelly fabianese? Giro d'italia rouleur derby ten dam gaul, colnago belgium bobet bahati the la fleche wallonne, paris-nice kaperij. Gavia horizontally stiff but vertically compliant feed zone criterium rodriguez, chicane commissaire omnium operacion puerto campagnolo fred.");
        tut.setText("# Tutorial content");
        tut.setFiles(Collections.emptyList());


        TutorialViewsFactory factory = Mockito.mock(TutorialViewsFactory.class);
        DialogActionsProvider dialogActionsProvider = new DialogActionsProvider() {
            @Override
            public void showDialog() {
                System.out.println("showing dialog");
            }

            @Override
            public void hideDialog() {
                System.out.println("hiding dialog");

            }
        }       ;
        TutorialDescriptionView view =new TutorialDescriptionView(tut, factory, dialogActionsProvider);

        VBox container = new VBox();
        container.getChildren().add(view);


        Scene scene = new Scene(container,800 ,600);

        StageUtils.setJFedStageIcons(primaryStage);
        primaryStage.setTitle(primaryStage.getTitle());
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
