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

<!--
/*
 * Copyright (C) 2018, 2019, 2022, 2023 Andrew Gegg
 *
 *	This file is part of the Garden Notebook application
 *
 * The Garden 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>.
 */

/*
    Change log
    2.1.0   Better preset date range options than just 'This year'
    2.3.0   Purchase selection by product
            Drop down menu for periods now legible
    3.0.0   Selection by Location
    3.0.1   Trap short form dates to circumvent bug JDK-8269867 in JavaFX
    3.0.3   Add Copy Date button
    3.1.0   Use SafeDatePicker
 */

-->

<?import java.net.URL?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Accordion?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.MenuButton?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ButtonBar?>
<!--<?import javafx.scene.control.DatePicker?>-->
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TreeTableColumn?>
<?import javafx.scene.control.TreeTableView?>
<?import javafx.scene.control.TitledPane?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.ToggleGroup?>
<?import javafx.scene.control.TreeView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.HBox?>

<!--<?import javafx.scene.control.Separator?>-->
<?import uk.co.gardennotebook.SafeDatePicker?>
<fx:root id="AnchorPane" prefHeight="400.0" prefWidth="516.0" type="javafx.scene.layout.AnchorPane" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1">
    <stylesheets>
        <URL value="@notebook.css" />
    </stylesheets>
    <children>
        <BorderPane prefHeight="400.0" prefWidth="516.0" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="5.0">
            <bottom>
                <ButtonBar prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
                    <buttons>
                        <Button id="btnFetch" fx:id="btnFetch" mnemonicParsing="false" onAction="#btnFetchOnAction" styleClass="notebook-cmd-button" text="%btn.fetch" />
                    </buttons>
                </ButtonBar>
            </bottom>
            <center>
                <Accordion BorderPane.alignment="CENTER">
                    <panes>
                        <TitledPane id="tpHusbandry" fx:id="tpHusbandry" animated="true" text="%title.husbandry">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbHusbandrySelectAll" fx:id="tgbHusbandrySelectAll" mnemonicParsing="false" onAction="#tgbHusbandrySelectAllOnAction" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="hbdGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbHusbandryClearAll" fx:id="tgbHusbandryClearAll" mnemonicParsing="false" onAction="#tgbHusbandryClearAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$hbdGroup" />
                                    <Button id="btnHusbandryAdd" fx:id="btnHusbandryAdd" mnemonicParsing="false" onAction="#btnHusbandryAddOnAction" styleClass="notebook-cmd-button" text="%btn.useAdd" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <TableView id="lvHusbandryClass" fx:id="lvHusbandryClass" editable="true"
                                               prefHeight="200.0" prefWidth="516.0" AnchorPane.bottomAnchor="0.0"
                                               AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                                               AnchorPane.topAnchor="0.0">
                                        <columns>
                                            <TableColumn id="lvHusbandryClassCheck" fx:id="lvHusbandryClassCheck"
                                                         prefWidth="75.0" sortable="false" text="%col.check"/>
                                            <TableColumn id="lvHusbandryClassName" fx:id="lvHusbandryClassName"
                                                         prefWidth="75.0" sortable="false" text="%col.name"/>
                                            <TableColumn id="lvHusbandryClassDesc" fx:id="lvHusbandryClassDesc"
                                                         prefWidth="75.0" sortable="false" text="%col.description"/>
                                        </columns>
                                    </TableView>
                                </AnchorPane>
                            </content>
                        </TitledPane>

                        <TitledPane animated="true" text="%title.groundwork">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbGWASelectAll" fx:id="tgbGWASelectAll" mnemonicParsing="false" onAction="#tgbGWASelectAllOnAction" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="gwkGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbGWAClearAll" fx:id="tgbGWAClearAll" mnemonicParsing="false" onAction="#tgbGWAClearAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$gwkGroup" />
                                    <Button id="btnGroundworkAdd" fx:id="btnGroundworkAdd" mnemonicParsing="false" onAction="#btnGroundworkAddOnAction" styleClass="notebook-cmd-button" text="%btn.useAdd" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <TableView id="lvGroundworkActivity" fx:id="lvGroundworkActivity" editable="true"
                                               prefHeight="200.0" prefWidth="516.0" AnchorPane.bottomAnchor="0.0"
                                               AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                                               AnchorPane.topAnchor="0.0">
                                        <columns>
                                            <TableColumn id="lvGroundworkActivityCheck"
                                                         fx:id="lvGroundworkActivityCheck" prefWidth="75.0"
                                                         sortable="false" text="%col.check"/>
                                            <TableColumn id="lvGroundworkActivityName" fx:id="lvGroundworkActivityName"
                                                         prefWidth="75.0" sortable="false" text="%col.name"/>
                                            <TableColumn id="lvGroundworkActivityDesc" fx:id="lvGroundworkActivityDesc"
                                                         prefWidth="75.0" sortable="false" text="%col.description"/>
                                        </columns>
                                    </TableView>
                                </AnchorPane>
                            </content>
                        </TitledPane>

                        <TitledPane animated="true" text="%title.affliction">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbAfflictionSelectAll" fx:id="tgbAfflictionSelectAll" mnemonicParsing="false" onAction="#tgbAfflictionSelectAllOnAction" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="pdGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbAfflictionClearAll" fx:id="tgbAfflictionClearAll" mnemonicParsing="false" onAction="#tgbAfflictionClearAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$pdGroup" />
                                    <Button id="btnAfflictionAdd" fx:id="btnAfflictionAdd" mnemonicParsing="false" onAction="#btnAfflictionAddOnAction" styleClass="notebook-cmd-button" text="%btn.useAdd" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <TableView id="lvAffliction" fx:id="lvAffliction" editable="true" prefHeight="200.0"
                                               prefWidth="516.0" AnchorPane.bottomAnchor="0.0"
                                               AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                                               AnchorPane.topAnchor="0.0">
                                        <columns>
                                            <TableColumn id="lvAfflictionCheck" fx:id="lvAfflictionCheck"
                                                         prefWidth="75.0" sortable="false" text="%col.check"/>
                                            <TableColumn id="lvAfflictionName" fx:id="lvAfflictionName" prefWidth="75.0"
                                                         sortable="false" text="%col.name"/>
                                            <TableColumn id="lvAfflictionDesc" fx:id="lvAfflictionDesc" prefWidth="75.0"
                                                         sortable="false" text="%col.description"/>
                                        </columns>
                                    </TableView>
                                </AnchorPane>
                            </content>
                        </TitledPane>

                        <TitledPane animated="true" text="%title.purchases">
                            <graphic>
                                <HBox>
                                    <fx:define>
                                        <ToggleGroup fx:id="purGroup" />
                                    </fx:define> 
                                    <ToggleButton id="tgbPurchasesSelectAll" fx:id="tgbPurchasesSelectAll" mnemonicParsing="false" onAction="#tgbPurchasesSelectAllOnAction" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="purGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbPurchasesClearAll" fx:id="tgbPurchasesClearAll" mnemonicParsing="false" onAction="#tgbPurchasesClearAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$purGroup" />
                                    <Button id="btnPurchaseAdd" fx:id="btnPurchaseAdd" mnemonicParsing="false" onAction="#btnPurchaseAddOnAction" styleClass="notebook-cmd-button" text="%btn.useAdd" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <children>
                                        <TabPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
                                            <tabs>
                                                <Tab text="%tab.retailer" closable="false" >
                                                    <content>
                                                        <GridPane>
                                                            <columnConstraints>
                                                                <ColumnConstraints hgrow="ALWAYS" minWidth="10.0"
                                                                                   prefWidth="100.0"/>
                                                            </columnConstraints>
                                                            <rowConstraints>
                                                                <RowConstraints maxHeight="173.0" vgrow="SOMETIMES"/>
                                                                <RowConstraints minHeight="10.0" vgrow="ALWAYS"/>
                                                            </rowConstraints>
                                                            <HBox>
                                                                <fx:define>
                                                                    <ToggleGroup fx:id="rtlGroup"/>
                                                                </fx:define>
                                                                <ToggleButton id="tgbRetailersSelectAll"
                                                                              fx:id="tgbRetailersSelectAll"
                                                                              mnemonicParsing="false"
                                                                              onAction="#tgbRetailersSelectAllOnAction"
                                                                              styleClass="notebook-cmd-button"
                                                                              text="%btn.useAll">
                                                                    <toggleGroup>
                                                                        <ToggleGroup fx:id="rtlGroup"/>
                                                                    </toggleGroup>
                                                                </ToggleButton>
                                                                <ToggleButton id="tgbRetailersClearAll"
                                                                              fx:id="tgbRetailersClearAll"
                                                                              mnemonicParsing="false"
                                                                              onAction="#tgbRetailersClearAllOnAction"
                                                                              selected="true"
                                                                              styleClass="notebook-cmd-button"
                                                                              text="%btn.useNone"
                                                                              toggleGroup="$rtlGroup"/>
                                                            </HBox>
                                                            <TableView id="lvRetailers" fx:id="lvRetailers"
                                                                       editable="true" prefHeight="200.0"
                                                                       prefWidth="516.0" GridPane.rowIndex="1">
                                                                <columns>
                                                                    <TableColumn id="lvRetailersCheck"
                                                                                 fx:id="lvRetailersCheck"
                                                                                 prefWidth="75.0" sortable="false"
                                                                                 text="%col.check"/>
                                                                    <TableColumn id="lvRetailersName"
                                                                                 fx:id="lvRetailersName"
                                                                                 prefWidth="75.0" sortable="false"
                                                                                 text="%col.name"/>
                                                                    <TableColumn id="lvRetailersDesc"
                                                                                 fx:id="lvRetailersDesc"
                                                                                 prefWidth="75.0" sortable="false"
                                                                                 text="%col.description"/>
                                                                </columns>
                                                            </TableView>
                                                        </GridPane>
                                                    </content>
                                                </Tab>
                                                <Tab text="%tab.productcategory" closable="false" >
                                                    <content>
                                                        <GridPane>
                                                            <columnConstraints>
                                                                <ColumnConstraints hgrow="ALWAYS" minWidth="10.0"
                                                                                   prefWidth="100.0"/>
                                                            </columnConstraints>
                                                            <rowConstraints>
                                                                <RowConstraints maxHeight="173.0" vgrow="SOMETIMES"/>
                                                                <RowConstraints minHeight="10.0" vgrow="ALWAYS"/>
                                                            </rowConstraints>
                                                            <HBox>
                                                                <fx:define>
                                                                    <ToggleGroup fx:id="pcatGroup"/>
                                                                </fx:define>
                                                                <ToggleButton id="tgbProdCatsSelectAll"
                                                                              fx:id="tgbProdCatsSelectAll"
                                                                              mnemonicParsing="false"
                                                                              onAction="#tgbProdCatsSelectAllOnAction"
                                                                              styleClass="notebook-cmd-button"
                                                                              text="%btn.useAll">
                                                                    <toggleGroup>
                                                                        <ToggleGroup fx:id="pcatGroup"/>
                                                                    </toggleGroup>
                                                                </ToggleButton>
                                                                <ToggleButton id="tgbProdCatsClearAll"
                                                                              fx:id="tgbProdCatsClearAll"
                                                                              mnemonicParsing="false"
                                                                              onAction="#tgbProdCatsClearAllOnAction"
                                                                              selected="true"
                                                                              styleClass="notebook-cmd-button"
                                                                              text="%btn.useNone"
                                                                              toggleGroup="$pcatGroup"/>
                                                                <ToggleButton id="tgbProdCatsPlantLike"
                                                                              fx:id="tgbProdCatsPlantLike"
                                                                              mnemonicParsing="false"
                                                                              onAction="#tgbProdCatsPlantLikeOnAction"
                                                                              styleClass="notebook-cmd-button"
                                                                              text="%btn.plantLike"
                                                                              toggleGroup="$pcatGroup"/>
                                                            </HBox>
                                                            <TableView id="lvProdCats" fx:id="lvProdCats"
                                                                       editable="true" prefHeight="200.0"
                                                                       prefWidth="516.0" GridPane.rowIndex="1">
                                                                <columns>
                                                                    <TableColumn id="lvProdCatsCheck"
                                                                                 fx:id="lvProdCatsCheck"
                                                                                 prefWidth="75.0" sortable="false"
                                                                                 text="%col.check"/>
                                                                    <TableColumn id="lvProdCatsName"
                                                                                 fx:id="lvProdCatsName" prefWidth="75.0"
                                                                                 sortable="false" text="%col.name"/>
                                                                    <TableColumn id="lvProdCatsPlantLike"
                                                                                 fx:id="lvProdCatsPlantLike"
                                                                                 prefWidth="75.0" sortable="false"
                                                                                 text="%col.plantlike"/>
                                                                    <TableColumn id="lvProdCatsDesc"
                                                                                 fx:id="lvProdCatsDesc" prefWidth="75.0"
                                                                                 sortable="false"
                                                                                 text="%col.description"/>
                                                                </columns>
                                                            </TableView>
                                                        </GridPane>
                                                    </content>
                                                </Tab>
                                                <Tab text="%tab.productbrand" closable="false" >
                                                    <content>
                                                        <GridPane>
                                                            <columnConstraints>
                                                                <ColumnConstraints hgrow="ALWAYS" minWidth="10.0"
                                                                                   prefWidth="100.0"/>
                                                            </columnConstraints>
                                                            <rowConstraints>
                                                                <RowConstraints maxHeight="173.0" vgrow="SOMETIMES"/>
                                                                <RowConstraints minHeight="10.0" vgrow="ALWAYS"/>
                                                            </rowConstraints>
                                                            <HBox>
                                                                <fx:define>
                                                                    <ToggleGroup fx:id="pbrGroup"/>
                                                                </fx:define>
                                                                <ToggleButton id="tgbProdBrandsSelectAll"
                                                                              fx:id="tgbProdBrandsSelectAll"
                                                                              mnemonicParsing="false"
                                                                              onAction="#tgbProdBrandsSelectAllOnAction"
                                                                              styleClass="notebook-cmd-button"
                                                                              text="%btn.useAll">
                                                                    <toggleGroup>
                                                                        <ToggleGroup fx:id="pbrGroup"/>
                                                                    </toggleGroup>
                                                                </ToggleButton>
                                                                <ToggleButton id="tgbProdBrandsClearAll"
                                                                              fx:id="tgbProdBrandsClearAll"
                                                                              mnemonicParsing="false"
                                                                              onAction="#tgbProdBrandsClearAllOnAction"
                                                                              selected="true"
                                                                              styleClass="notebook-cmd-button"
                                                                              text="%btn.useNone"
                                                                              toggleGroup="$pbrGroup"/>
                                                            </HBox>
                                                            <TableView id="lvProdBrands" fx:id="lvProdBrands"
                                                                       editable="true" prefWidth="516.0"
                                                                       GridPane.rowIndex="1">
                                                                <columns>
                                                                    <TableColumn id="lvProdBrandsCheck"
                                                                                 fx:id="lvProdBrandsCheck"
                                                                                 prefWidth="75.0" sortable="false"
                                                                                 text="%col.check"/>
                                                                    <TableColumn id="lvProdBrandsName"
                                                                                 fx:id="lvProdBrandsName"
                                                                                 prefWidth="75.0" sortable="false"
                                                                                 text="%col.name"/>
                                                                    <TableColumn id="lvProdBrandsDesc"
                                                                                 fx:id="lvProdBrandsDesc"
                                                                                 prefWidth="75.0" sortable="false"
                                                                                 text="%col.description"/>
                                                                </columns>
                                                            </TableView>
                                                        </GridPane>
                                                    </content>
                                                </Tab>
                                            </tabs>
                                        </TabPane>
                                    </children>
                                </AnchorPane>
                            </content>
                        </TitledPane>

                        <TitledPane animated="true" text="%title.weather">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbWeatherSelectAll" fx:id="tgbWeatherSelectAll" mnemonicParsing="false" onAction="#tgbWeatherSelectAllOnAction" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="wthGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbWeatherClearAll" fx:id="tgbWeatherClearAll" mnemonicParsing="false" onAction="#tgbWeatherClearAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$wthGroup" />
                                    <Button id="btnWeatherAdd" fx:id="btnWeatherAdd" mnemonicParsing="false" onAction="#btnWeatherAddOnAction" styleClass="notebook-cmd-button" text="%btn.useAdd" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <TableView id="lvWeather" fx:id="lvWeather" editable="true" prefHeight="200.0"
                                               prefWidth="516.0" AnchorPane.bottomAnchor="0.0"
                                               AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                                               AnchorPane.topAnchor="0.0">
                                        <columns>
                                            <TableColumn id="lvWeatherCheck" fx:id="lvWeatherCheck" prefWidth="75.0"
                                                         sortable="false" text="%col.check"/>
                                            <TableColumn id="lvWeatherName" fx:id="lvWeatherName" prefWidth="75.0"
                                                         sortable="false" text="%col.name"/>
                                            <TableColumn id="lvWeatherDesc" fx:id="lvWeatherDesc" prefWidth="75.0"
                                                         sortable="false" text="%col.description"/>
                                        </columns>
                                    </TableView>
                                </AnchorPane>
                            </content>
                        </TitledPane>

                        <TitledPane text="%title.wildlife">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbWildlifeSelectAll" fx:id="tgbWildlifeSelectAll" mnemonicParsing="false" onAction="#tgbWildlifeSelectAllOnAction" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="wlfGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbWildlifeClearAll" fx:id="tgbWildlifeClearAll" mnemonicParsing="false" onAction="#tgbWildlifeClearAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$wlfGroup" />
                                    <Button id="btnWildlifeAdd" fx:id="btnWildlifeAdd" mnemonicParsing="false" onAction="#btnWildlifeAddOnAction" styleClass="notebook-cmd-button" text="%btn.useAdd" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <TableView id="lvWildlife" fx:id="lvWildlife" editable="true" prefHeight="200.0"
                                               prefWidth="516.0" AnchorPane.bottomAnchor="0.0"
                                               AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                                               AnchorPane.topAnchor="0.0">
                                        <columns>
                                            <TableColumn id="lvWildlifeCheck" fx:id="lvWildlifeCheck" prefWidth="75.0"
                                                         sortable="false" text="%col.check"/>
                                            <TableColumn id="lvWildlifeName" fx:id="lvWildlifeName" prefWidth="75.0"
                                                         sortable="false" text="%col.name"/>
                                            <TableColumn id="lvWildlifeDesc" fx:id="lvWildlifeDesc" prefWidth="75.0"
                                                         sortable="false" text="%col.description"/>
                                        </columns>
                                    </TableView>
                                </AnchorPane>
                            </content>
                        </TitledPane>

                        <TitledPane animated="true" text="%title.sales">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbSalesSelectAll" fx:id="tgbSalesSelectAll" mnemonicParsing="false" onAction="#tgbSalesSelectAllOnAction" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="saleGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbSalesClearAll" fx:id="tgbSalesClearAll" mnemonicParsing="false" onAction="#tgbSalesClearAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$saleGroup" />
                                    <Button id="btnSaleAdd" fx:id="btnSaleAdd" mnemonicParsing="false" onAction="#btnSaleAddOnAction" styleClass="notebook-cmd-button" text="%btn.useAdd" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                            </content>
                        </TitledPane>

                        <TitledPane animated="true" text="%title.journal">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbJournalSelectAll" fx:id="tgbJournalSelectAll" mnemonicParsing="false" onAction="#tgbJournalSelectAllOnAction" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="journalGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbJournalClearAll" fx:id="tgbJournalClearAll" mnemonicParsing="false" onAction="#tgbJournalClearAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$journalGroup" />
                                    <Button id="btnJournalAdd" fx:id="btnJournalAdd" mnemonicParsing="false" onAction="#btnJournalAddOnAction" styleClass="notebook-cmd-button" text="%btn.useAdd" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                            </content>
                        </TitledPane>

                        <TitledPane animated="false" disable="true"/>

                        <TitledPane animated="true" text="%title.plants">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbPlantsSelectAll" fx:id="tgbPlantsSelectAll" mnemonicParsing="false" onAction="#tgbPlantsSelectAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="pltGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbPlantsClearAll" fx:id="tgbPlantsClearAll" mnemonicParsing="false" onAction="#tgbPlantsClearAllOnAction" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$pltGroup" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <TreeView id="tvPlants" fx:id="tvPlants" prefHeight="200.0" prefWidth="516.0"
                                              showRoot="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
                                              AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
                                </AnchorPane>
                            </content>
                        </TitledPane>

                        <TitledPane animated="true" text="%title.locations">
                            <graphic>
                                <HBox>
                                    <ToggleButton id="tgbLocationSelectAll" fx:id="tgbLocationSelectAll" mnemonicParsing="false" onAction="#tgbLocationsSelectAllOnAction" selected="true" styleClass="notebook-cmd-button" text="%btn.useAll">
                                        <toggleGroup>
                                            <ToggleGroup fx:id="locGroup" />
                                        </toggleGroup>
                                    </ToggleButton>
                                    <ToggleButton id="tgbLocationsClearAll" fx:id="tgbLocationsClearAll" mnemonicParsing="false" onAction="#tgbLocationsClearAllOnAction" styleClass="notebook-cmd-button" text="%btn.useNone" toggleGroup="$locGroup" />
                                </HBox>
                            </graphic>
                            <contentDisplay>LEFT</contentDisplay>
                            <graphicTextGap>20</graphicTextGap>
                            <content>
                                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <TreeTableView id="tvLocations" fx:id="tvLocations" prefHeight="200.0" prefWidth="516.0" editable="true"
                                              showRoot="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
                                              AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" >

                                        <columns>
                                            <TreeTableColumn id="tvLocationsName" fx:id="tvLocationsName" prefWidth="75.0"
                                                         sortable="false" text="%col.name"/>
                                           <TreeTableColumn id="tvLocationsCheck" fx:id="tvLocationsCheck" prefWidth="75.0"
                                                             sortable="false" text="%col.check"/>
                                            <TreeTableColumn id="tvLocationsDesc" fx:id="tvLocationsDesc" prefWidth="75.0"
                                                         sortable="false" text="%col.description"/>
                                        </columns>
                                    </TreeTableView>
                                </AnchorPane>
                            </content>
                        </TitledPane>

                    </panes>
                </Accordion>
            </center>
            <top>
                <HBox prefHeight="37.0" prefWidth="516.0" BorderPane.alignment="CENTER" alignment="BASELINE_LEFT">
 <!--                   <padding>
                        <Insets top="5.0"/>
                    </padding> -->
                    <Label text="%lbl.from.date" />
<!--                    <SafeDatePicker id="dtpFrom" fx:id="dtpFrom" promptText="%lbl.from.prompt" onAction="#dtpFromOnAction">-->
                    <SafeDatePicker id="dtpFrom" fx:id="dtpFrom" promptText="%lbl.from.prompt" >
                        <HBox.margin>
                            <Insets left="10.0"/>
                        </HBox.margin>
                    </SafeDatePicker>
                    <Button text="%btn.diary.copydate" id="btnCopyDate" fx:id="btnCopyDate" mnemonicParsing="false" onAction="#btnCopyDateOnAction" styleClass="notebook-cmd-button" >
                        <HBox.margin>
                            <Insets left="10.0"/>
                        </HBox.margin>
                    </Button>
                    <Label text="%lbl.to.date">
                        <HBox.margin>
                            <Insets left="10.0"/>
                        </HBox.margin>
                    </Label>
<!--                    <SafeDatePicker id="dtpTo" fx:id="dtpTo" promptText="%lbl.to.prompt" onAction="#dtpToOnAction">-->
                    <SafeDatePicker id="dtpTo" fx:id="dtpTo" promptText="%lbl.to.prompt" >
                        <HBox.margin>
                            <Insets left="10.0"/>
                        </HBox.margin>
                    </SafeDatePicker>
                    <MenuButton text="%btn.menuperiod">
                        <items>
                            <MenuItem id="btnThisYear" fx:id="btnThisYear" mnemonicParsing="false" onAction="#btnThisYearOnAction" text="%btn.periodthisyear"/>
                            <MenuItem id="btn1Week" fx:id="btn1Week" mnemonicParsing="false" onAction="#btnbtn1WeekOnAction" text="%btn.period1week"/>
                            <MenuItem id="btn3Months" fx:id="btn3Months" mnemonicParsing="false" onAction="#btn3MonthsOnAction" text="%btn.period3months"/>
                            <MenuItem id="btn6Months" fx:id="btn6Months" mnemonicParsing="false" onAction="#btn6MonthsOnAction" text="%btn.period6months"/>
                            <MenuItem id="btn12Months" fx:id="btn12Months" mnemonicParsing="false" onAction="#btn12MonthsOnAction" text="%btn.period12months"/>
                            <MenuItem id="btnLastYear" fx:id="btnLastYear" mnemonicParsing="false" onAction="#btnLastYearOnAction" text="%btn.periodlastyear"/>
                        </items>
                        <HBox.margin>
                            <Insets left="10.0"/>
                        </HBox.margin>
                    </MenuButton>
                </HBox>
            </top>
        </BorderPane>
    </children>
</fx:root>
