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

<!--
  ~
  ~  Copyright (C) 2021 Andrew Gegg
  ~
  ~ 	This file is part of the Gardeners Notebook application
  ~
  ~  The Gardeners Notebook application is free software: you can redistribute it and/or modify
  ~  it under the terms of the GNU General Public License as published by
  ~  the Free Software Foundation, either version 3 of the License, or
  ~  (at your option) any later version.
  ~
  ~  This program is distributed in the hope that it will be useful,
  ~  but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~  GNU General Public License for more details.
  ~
  ~   You should have received a copy of the GNU General Public License
  ~  along with this program.  If not, see <http://www.gnu.org/licenses/gpl.html>.
  ~
  ~
  -->

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.TreeTableColumn?>
<?import javafx.scene.control.TreeTableView?>
<?import javafx.scene.control.MenuButton?>
<?import javafx.scene.control.ContextMenu?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuItem?>

<?import java.net.URL?>

<fx:root type="javafx.scene.layout.AnchorPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="404.0" prefWidth="600.0"
         xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
    <stylesheets>
        <URL value="@notebook.css"/>
    </stylesheets>

    <BorderPane prefHeight="404.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0"
                AnchorPane.topAnchor="5.0">
        <center>
            <TreeTableView id="tblCatalogue" fx:id="tblCatalogue" editable="true" maxHeight="1.7976931348623157E308" prefHeight="515.0" prefWidth="600.0"
                           showRoot="false">
                <columns>
                    <TreeTableColumn id="colYear" fx:id="colYear" prefWidth="75.0" text="%col.review.year" editable="false"/>
                    <TreeTableColumn id="colLocation" fx:id="colLocation" prefWidth="75.0" text="%col.plan.location" editable="true"/>
                    <TreeTableColumn id="colCropRotationGroup" fx:id="colCropRotationGroup" prefWidth="75.0" text="%col.plan.croprotationgroup" editable="true"/>
                    <TreeTableColumn id="colComment" fx:id="colComment" prefWidth="75.0" text="%col.comment" editable="true"/>
                </columns>
                <contextMenu>
                    <ContextMenu onShowing="#ctxmnuOnShowing">
                        <items>
                            <MenuItem id="ctxmnuChange" onAction="#ctxmnuChangeOnAction" text="%menu.change"/>
                            <MenuItem id="ctxmnuDelete" fx:id="ctxmnuDelete" onAction="#ctxmnuDeleteOnAction" text="%menu.delete"/>
                            <!-- <Menu text="%menu.add"> -->
                                <MenuItem id="ctxmnuReview" fx:id="ctxmnuReview" mnemonicParsing="false"
                                          onAction="#ctxmnuAddPlanOnAction" text="%menu.plan.newplan"/>
                                <!-- <MenuItem id="ctxmnuYear" fx:id="ctxmnuYear" mnemonicParsing="false" onAction="#ctxmnuAddYearOnAction"
                                          text="%menu.review.newyear"/>
                            </Menu> -->
                        </items>
                    </ContextMenu>
                </contextMenu>
            </TreeTableView>
        </center>
        <bottom>
            <ButtonBar prefHeight="40.0" prefWidth="200.0">
                <buttons>
                    <Button id="btnAdd" fx:id="btnAdd" mnemonicParsing="false" text="%btn.add" onAction="#btnAddOnAction" styleClass="notebook-cmd-button"/>
                    <Button id="btnChange" fx:id="btnChange" mnemonicParsing="false" text="%btn.change" onAction="#btnChangeOnAction"
                            styleClass="notebook-cmd-button"/>
                    <Button id="btnDelete" fx:id="btnDelete" mnemonicParsing="false" text="%btn.delete" onAction="#btnDeleteOnAction"
                            styleClass="notebook-cmd-button"/>
                </buttons>
            </ButtonBar>

        </bottom>
    </BorderPane>
</fx:root>
