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

<?import javafx.scene.control.cell.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.*?>


<?import ru.trader.view.support.cells.DoubleCell?>

<?import ru.trader.view.support.cells.OfferCellValueImpl?>
<?import ru.trader.view.support.cells.OfferTableCell?>
<?import ru.trader.view.support.cells.DistanceCell?>
<HBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
      fx:controller="ru.trader.controllers.TopOrdersController" styleClass="dialog"
      prefWidth="725">
    <TableView fx:id="tblOrders" editable="true">
        <columns>
            <TableColumn minWidth="160.0" text="%market.item">
                <cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
            </TableColumn>
            <TableColumn minWidth="160.0" text="%market.order.seller">
                <cellValueFactory><OfferCellValueImpl property="offer"/></cellValueFactory>
            </TableColumn>
            <TableColumn fx:id="count" minWidth="60.0" text="%market.order.count">
                <cellValueFactory><PropertyValueFactory property="count"/></cellValueFactory>
            </TableColumn>
            <TableColumn minWidth="160.0" text="%market.order.buyer">
                <cellValueFactory><OfferCellValueImpl property="buyOffer"/></cellValueFactory>
            </TableColumn>
            <TableColumn minWidth="80.0" text="%market.order.distance">
                <cellFactory><DistanceCell /></cellFactory>
                <cellValueFactory><PropertyValueFactory property="distance"/></cellValueFactory>
            </TableColumn>
            <TableColumn fx:id="profit" minWidth="80.0" text="%market.order.profit" sortType="DESCENDING">
                <cellFactory><DoubleCell/></cellFactory>
                <cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory>
            </TableColumn>
        </columns>
        <columnResizePolicy>
            <TableView fx:constant="UNCONSTRAINED_RESIZE_POLICY"/>
        </columnResizePolicy>
        <sortOrder>
            <fx:reference source="profit"/>
        </sortOrder>
    </TableView>
</HBox>
