<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.*?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<HBox
    xmlns="http://javafx.com/javafx"
    xmlns:fx="http://javafx.com/fxml"
    fx:controller="com.andrewlalis.perfin.control.SqlConsoleViewController"
    styleClass="std-spacing"
>
    <VBox HBox.hgrow="ALWAYS">
        <ScrollPane fitToWidth="true" fitToHeight="true" VBox.vgrow="ALWAYS">
            <TextArea
                    fx:id="sqlEditorTextArea"
                    promptText="Write your SQL query here..."
                    styleClass="mono-font,small-font"
            />
        </ScrollPane>
        <HBox styleClass="std-padding,std-spacing">
            <Button text="Execute Query" onAction="#executeQuery"/>
            <Button text="View Schema" onAction="#showSchema"/>
            <Button text="Save Query" onAction="#saveQuery"/>
            <Button text="Export to File" onAction="#exportToFile"/>
        </HBox>
        <ScrollPane fitToHeight="true" fitToWidth="true">
            <TextArea
                    fx:id="outputTextArea"
                    styleClass="mono-font,small-font"
                    maxHeight="800"
            />
        </ScrollPane>
    </VBox>

    <VBox HBox.hgrow="SOMETIMES" minWidth="300" prefWidth="300">
        <Label text="Saved Queries"/>
        <ScrollPane styleClass="tile-container-scroll" VBox.vgrow="ALWAYS">
            <VBox fx:id="savedQueriesVBox" styleClass="tile-container"/>
        </ScrollPane>
    </VBox>
</HBox>
