de.caff.util.table

## Class ReadOnlyPropertyTableModel

- java.lang.Object
- - javax.swing.table.AbstractTableModel
  - - de.caff.util.table.ReadOnlyPropertyTableModel

- All Implemented Interfaces:
    java.io.Serializable, javax.swing.table.TableModel

      public class ReadOnlyPropertyTableModel
      extends javax.swing.table.AbstractTableModel

  Table model displaying the properties of an object.

  It considers the object's public fields and public parameters plus non-void `getXXX()` and boolean `isXXX()` methods as defining properties. You can hide such a field or a method from being used by marking it with the `PropertyHide` annotation. You can change the automatically created name by marking it with the `PropertyName` annotation.

  It uses reflection to access the properties, so it might fail in restricted environments.

  Author:
    Rammi
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `COLUMN_INDEX_NAME` The column index of the property name.
    `static int` | `COLUMN_INDEX_VALUE` The column index of the property value.

    - ### Fields inherited from class javax.swing.table.AbstractTableModel

      `listenerList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReadOnlyPropertyTableModel(java.lang.Object object)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getColumnCount()` Returns the number of columns in the model.
    `java.lang.String` | `getColumnName(int column)` Returns the name for a column.
    `int` | `getRowCount()` Returns the number of rows in the model.
    `java.lang.Object` | `getValueAt(int rowIndex, int columnIndex)` Returns the value for the cell at `columnIndex` and `rowIndex`.
    `boolean` | `isCellEditable(int rowIndex, int columnIndex)` Returns false.
    `void` | `update()` Update the model.

    - ### Methods inherited from class javax.swing.table.AbstractTableModel

      `addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### COLUMN_INDEX_NAME

          public static final int COLUMN_INDEX_NAME

      The column index of the property name.
      See Also:
        Constant Field Values

    - #### COLUMN_INDEX_VALUE

          public static final int COLUMN_INDEX_VALUE

      The column index of the property value.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ReadOnlyPropertyTableModel

          public ReadOnlyPropertyTableModel(@Nullable
                                            java.lang.Object object)

      Constructor.
      Parameters:
        `object` - object to handle

  - ### Method Detail

    - #### getRowCount

          public int getRowCount()

      Returns the number of rows in the model. A `JTable` uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.
      Returns:
        the number of rows in the model
      See Also:
        `getColumnCount()`

    - #### getColumnCount

          public int getColumnCount()

      Returns the number of columns in the model. A `JTable` uses this method to determine how many columns it should create and display by default.
      Returns:
        the number of columns in the model
      See Also:
        `getRowCount()`

    - #### getValueAt

          public java.lang.Object getValueAt(int rowIndex,
                                             int columnIndex)

      Returns the value for the cell at `columnIndex` and `rowIndex`.
      Parameters:
        `rowIndex` - the row whose value is to be queried
        `columnIndex` - the column whose value is to be queried
      Returns:
        the value Object at the specified cell

    - #### isCellEditable

          public boolean isCellEditable(int rowIndex,
                                        int columnIndex)

      Returns false.
      Specified by:
        `isCellEditable` in interface `javax.swing.table.TableModel`
      Overrides:
        `isCellEditable` in class `javax.swing.table.AbstractTableModel`
      Parameters:
        `rowIndex` - the row being queried
        `columnIndex` - the column being queried
      Returns:
        false

    - #### getColumnName

          public java.lang.String getColumnName(int column)

      Returns the name for a column.
      Specified by:
        `getColumnName` in interface `javax.swing.table.TableModel`
      Overrides:
        `getColumnName` in class `javax.swing.table.AbstractTableModel`
      Parameters:
        `column` - the column being queried
      Returns:
        a string containing the default name of `column`

    - #### update

          public void update()

      Update the model.