package leigh.memory;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import leigh.eo.EO;
import leigh.eo.EOLoop;

public class MemoryApp extends Application {
    private SplitPane root;
    private final EOLoop zettel = new EOLoop();

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Hello World!");

        root = new SplitPane();

        root.getItems().add(makeWestPanel());

        primaryStage.setScene(new Scene(root, 300, 250));
        primaryStage.show();
    }

    public VBox makeWestPanel() {
        VBox west = new VBox();

        TableView tv = new TableView();

        ToolBar tb = new ToolBar();

        Button create = new Button("+");
        Button delete = new Button("-");

        tb.getItems().addAll(create, delete);

        TableColumn<EO, String> idCol = new TableColumn<>("ID");
        TableColumn<EO, String> titleCol = new TableColumn<>("Title");

        tv.getColumns().addAll(idCol, titleCol);

        west.getChildren().addAll(tb, tv);

        return west;
    }

}
