Class CustomEditorTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable

public class CustomEditorTable extends JTable
See Also:
  • Constructor Details

    • CustomEditorTable

      public CustomEditorTable(ObjectDialog dialog)
      Constructor for the CustomEditorTable class. Initializes the table with a default model and sets up the editor components map. This Custom Implementation allows for custom cell editing with dialog components while keeping track of Individual cell editors and their associated components in a Map.
  • Method Details

    • editCellAt

      public boolean editCellAt(int row, int column, EventObject e)
      Override of the JTable.editCellAt method to handle DialogCellEditor.
      Overrides:
      editCellAt in class JTable
      Parameters:
      row - the row to be edited
      column - the column to be edited
      e - event to pass into shouldSelectCell; note that as of Java 2 platform v1.2, the call to shouldSelectCell is no longer made
      Returns:
      true if editing was started; false otherwise
    • prepareDialogEditor

      public Component prepareDialogEditor(TableCellEditor editor, int row, int column)
    • prepareRenderer

      public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
      Override of the JTable.prepareRenderer method to set alternating row colors.
      Overrides:
      prepareRenderer in class JTable
    • getCellEditor

      public TableCellEditor getCellEditor()
      Overrides:
      getCellEditor in class JTable
    • getCellEditor

      public TableCellEditor getCellEditor(int row, int column)
      Overrides:
      getCellEditor in class JTable
    • getEditorCellEditor

      public TableCellEditor getEditorCellEditor(int row, int column)
      Retrieves the TableCellEditor at a specific cell position in the table.
      Parameters:
      row - the row index of the cell
      column - the column index of the cell
      Returns:
      the TableCellEditor associated with the cell, or null if not found
    • setCellEditor

      public void setCellEditor(int row, int column, Component component)
      Sets the cell editor for a specific cell in the table.
      Parameters:
      row - the row index of the cell
      column - the column index of the cell
      component - the JComponent to be used as the editor for the cell
    • setCellEditor

      public void setCellEditor(int row, int column, TableCellEditor editor)
      Sets the cell editor for a specific cell in the table with a TableCellEditor.
      Parameters:
      row - the row index of the cell
      column - the column index of the cell
      editor - the TableCellEditor to be used for the cell
    • clearTableRows

      public void clearTableRows()
      Clears all editor components from the table. This method is useful for resetting the table state or when the table is no longer needed.
    • setTableSchema

      public void setTableSchema(io.swagger.v3.oas.models.media.Schema<?> schema)
    • getTableSchema

      public io.swagger.v3.oas.models.media.Schema<?> getTableSchema()
    • setTableParameters

      public void setTableParameters(ArrayList<io.swagger.v3.oas.models.parameters.Parameter> parameters)
      Loades a list of parameters, updating the table and the model.
    • getTableParameters

      public ArrayList<io.swagger.v3.oas.models.parameters.Parameter> getTableParameters()
    • setModel

      public void setModel(TableModel dataModel)
      Overrides:
      setModel in class JTable
    • getRowIndex

      public int getRowIndex(CustomTableRow row)
    • getRowAt

      public CustomTableRow getRowAt(int rowIndex)
    • getRowCount

      public int getRowCount()
      Overrides:
      getRowCount in class JTable
    • getColumnCount

      public int getColumnCount()
      Overrides:
      getColumnCount in class JTable
    • getColumnName

      public String getColumnName(int column)
      Overrides:
      getColumnName in class JTable
    • getActiveNode

      public CustomTableNode getActiveNode()
    • setActiveModel

      public void setActiveModel(CustomEditorTableModel activeModel)
    • resetNode

      public void resetNode()
      Resets the active node to a new instance of CustomTableNode.