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

<?import com.andrewlalis.perfin.view.component.PropertiesPane?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane xmlns="http://javafx.com/javafx"
            xmlns:fx="http://javafx.com/fxml"
            fx:controller="com.andrewlalis.perfin.control.EditVendorController"
>
    <top>
        <Label text="Edit Vendor" styleClass="bold-text,large-font,std-padding"/>
    </top>
    <center>
        <ScrollPane fitToWidth="true" fitToHeight="true">
            <VBox style="-fx-max-width: 500px;">
                <!-- Basic properties -->
                <PropertiesPane hgap="5" vgap="5" styleClass="std-padding">
                    <columnConstraints>
                        <ColumnConstraints hgrow="NEVER" halignment="LEFT" minWidth="150"/>
                        <ColumnConstraints hgrow="ALWAYS" halignment="RIGHT"/>
                    </columnConstraints>

                    <Label text="Name" labelFor="${nameField}" styleClass="bold-text"/>
                    <TextField fx:id="nameField"/>

                    <Label text="Description" labelFor="${descriptionField}" styleClass="bold-text"/>
                    <TextArea
                            fx:id="descriptionField"
                            wrapText="true"
                            style="-fx-pref-height: 100px; -fx-min-height: 100px;"
                    />
                </PropertiesPane>

                <!-- Some stats about the vendor -->
                <PropertiesPane hgap="5" vgap="5" styleClass="std-padding">
                    <columnConstraints>
                        <ColumnConstraints hgrow="NEVER" halignment="LEFT" minWidth="150"/>
                        <ColumnConstraints hgrow="ALWAYS" halignment="RIGHT"/>
                    </columnConstraints>

                    <Label text="Total Spent" labelFor="${totalSpentField}" styleClass="bold-text"/>
                    <Label fx:id="totalSpentField" styleClass="mono-font"/>
                </PropertiesPane>


                <!-- Buttons -->
                <Separator/>
                <HBox styleClass="std-padding,std-spacing" alignment="CENTER_RIGHT">
                    <Button text="Save" fx:id="saveButton" onAction="#save"/>
                    <Button text="Cancel" onAction="#cancel"/>
                </HBox>
            </VBox>
        </ScrollPane>
    </center>
</BorderPane>
