Class TadukooTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ScrollPaneConstants

public class TadukooTable extends JScrollPane
Tadukoo Table is an extension of JScrollPane that contains a JTable. It provides methods for using Lists of OrderedMappedPojos to populate the JTable and to make it easier to update the table.
Since:
Alpha v.0.2
Version:
Alpha v.0.3.3
Author:
Logan Ferree (Tadukoo)
See Also:
  • Field Details

    • keyOrder

      private final List<String> keyOrder
      The order of the keys in the table - can be null to use the pojos in the data
  • Constructor Details

    • TadukooTable

      private TadukooTable(List<String> keyOrder, List<com.github.tadukoo.util.pojo.OrderedMappedPojo> data)
      Creates a new Tadukoo Table using the given parameters
      Parameters:
      keyOrder - The order of the keys in the table - can be null to use the pojos in the data
      data - The data to be put in the table
  • Method Details

    • builder

      public static TadukooTable.TadukooTableBuilder builder()
      Returns:
      A new TadukooTable.TadukooTableBuilder to use to make a TadukooTable
    • getKeyOrder

      public List<String> getKeyOrder()
      Returns:
      The order of the keys in the table - can be null to use the pojos in the data
    • getTable

      public JTable getTable()
      Returns:
      The JTable behind this Tadukoo Table
    • getTableModel

      public DefaultTableModel getTableModel()
      Returns:
      The DefaultTableModel behind this Tadukoo Table
    • setTableData

      public void setTableData(List<com.github.tadukoo.util.pojo.OrderedMappedPojo> data)
      Sets the columns and rows of the table based on the passed in data. If the key order was set on the Tadukoo Table, that key order will be used, otherwise the key order of the first pojo in the data will be used.
      Parameters:
      data - The pojos to use to populate the table
    • updatePojos

      public List<com.github.tadukoo.util.pojo.OrderedMappedPojo> updatePojos(List<com.github.tadukoo.util.pojo.OrderedMappedPojo> data)
      Update the passed in data based on the current values in the table
      Parameters:
      data - The List of pojos to be updated
      Returns:
      The newly updated pojos List
    • addEmptyRow

      public void addEmptyRow()
      Adds a new row to the end of the table with empty data
    • addRow

      public void addRow(com.github.tadukoo.util.pojo.OrderedMappedPojo row)
      Adds a new row to the end of the table using values from the passed in pojo
      Parameters:
      row - The OrderedMappedPojo to use to add data to the table