Class ListGridRow

java.lang.Object
com.jbstrap.ui.components.listgrid.ListGridRow

public class ListGridRow extends Object
Class representing a ListGrid row.
Since:
4.0
Author:
JBStrap
  • Constructor Details

    • ListGridRow

      protected ListGridRow(ListGrid parentGrid, List<ListGridColumn> columns, Record record)
      Parameters:
      parentGrid - The parent list grid component ionstance
      columns - A collection of columns in the list grid row
      record - The record used to populate the list grid row
      Throws:
      NullPointerException - Thrown if the collection is null
  • Method Details

    • setRecord

      public ListGridRow setRecord(Record record)
      Sets the list grid row record. If the specified record is different from the ones in the list grid row, data in the list grid row are updated.
      Parameters:
      record - The record to be added to the row List grid data is updated using the record here specified.
      Returns:
      List grid row
    • getRecord

      public Record getRecord()
      Gets the record in the list grid row.
      Returns:
      An instance of the list grid row or null if there is no record n the list grid row
    • getOriginalRecord

      public Record getOriginalRecord()
      Gets the original record in the list grid row. The row was initialized using this record.
      Returns:
      The initial record in the list grid row or null if there were no records in the list grid row
    • getState

      public ListGridRecordState getState()
      Gets the state of the list grid row record.
      Returns:
      List grid row record state
      See Also:
    • setRowIndex

      protected ListGridRow setRowIndex(int rowIndex)
      Parameters:
      rowIndex - The row index
      Returns:
      The list grid row
    • getRowIndex

      public int getRowIndex()
      Gets the list grid row index.
      Returns:
      List grid row index or -1 if index is not determined
    • setValue

      public ListGridRow setValue(String columnName, Object value)
      Sets the list grid row cell value.
      Parameters:
      columnName - Column name whose value is to be set
      value - The value to be set
      Returns:
      List grid row
    • setState

      protected final ListGridRow setState(ListGridRecordState state)
      Parameters:
      state - List grid row record state Available states are listed in the enum ListGridRecordState.
      Returns:
      List grid row
    • getCellValue

      protected Object getCellValue(String columnName)
      Parameters:
      columnName - Column name containing the value
      Returns:
      Value in the specified cell If there is no cell in the list grid row by the specified name, null is returned. If the specified cell is a rendered cell, the cell’s component is returned. If the cell is not a rendered one, the displayed text value is returned.
    • getCellByName

      protected com.jbstrap.ui.components.listgrid.ListGridCell getCellByName(String columnName)
      Parameters:
      columnName - Column name of the cell component
      Returns:
      Cell component for the specified row or null if the specified column does not exist in the list grid row
    • getCells

      protected List<com.jbstrap.ui.components.listgrid.ListGridCell> getCells()
      Returns:
      The list grid cells or empty list if not any cells in the row
    • getJsonData

      protected String getJsonData()
    • selectRow

      public ListGridRow selectRow()
    • deselectRow

      public ListGridRow deselectRow()