Class DefaultHistoryReferencesTableModel

    • Constructor Detail

      • DefaultHistoryReferencesTableModel

        public DefaultHistoryReferencesTableModel()
        Constructs a DefaultHistoryReferencesTableModel with the default columns.
        See Also:
        getDefaultColumns()
      • DefaultHistoryReferencesTableModel

        public DefaultHistoryReferencesTableModel​(HistoryReferencesTableModel.Column[] columns)
        Constructs a DefaultHistoryReferencesTableModel with the specified columns (in the specified order).
        Parameters:
        columns - the columns that will have the model
        Throws:
        java.lang.IllegalArgumentException - if columns is null or empty.
    • Method Detail

      • getColumnClass

        public java.lang.Class<?> getColumnClass​(HistoryReferencesTableModel.Column column)
        Returns the Class of the given column.
        Parameters:
        column - the column being queried
        Returns:
        the Class of the column
      • getRowCount

        public int getRowCount()
      • getPrototypeValue

        public java.lang.Object getPrototypeValue​(int columnIndex)
        Description copied from interface: HistoryReferencesTableModel
        Returns the prototype value for the given column index. The prototype value is a possible representation of the values that might exist in the column. It's used to set an expected width for the column.
        Parameters:
        columnIndex - the column index that will be checked.
        Returns:
        the prototype value for the column
      • getPrototypeValue

        public java.lang.Object getPrototypeValue​(HistoryReferencesTableModel.Column column)
        Returns the prototype value of the given column.
        Parameters:
        column - the column being queried
        Returns:
        the prototype value of the column
      • refreshEntryRow

        public void refreshEntryRow​(int historyReferenceId)
        Description copied from interface: HistoryReferencesTableModel
        Notifies the table model listeners that the entry with the given historyReferenceId has changed.

        The call to this method has no effect if there is no entry with the given ID.

        Parameters:
        historyReferenceId - the HistoryReference ID of the entry that has changed
        See Also:
        TableModelListener
      • refreshEntryRows

        public void refreshEntryRows()
      • removeEntry

        public void removeEntry​(int historyReferenceId)
        Description copied from interface: HistoryReferencesTableModel
        Removes the entry with the given historyReferenceId.

        The call to this method has no effect if there is no entry with the given ID.

        Parameters:
        historyReferenceId - the HistoryReference ID of the entry that will be removed
      • getEntryRowIndex

        public int getEntryRowIndex​(int historyReferenceId)
        Description copied from interface: HistoryReferencesTableModel
        Returns the row index of the entry with the given historyReferenceId. If there is no entry with the given ID -1 is returned.
        Parameters:
        historyReferenceId - the HistoryReference ID of the entry that will be searched
        Returns:
        the row index of the entry with the given HistoryReference ID, or -1 if there is no entry with the given ID
      • getEntryWithHistoryId

        public DefaultHistoryReferencesTableEntry getEntryWithHistoryId​(int historyId)
        Description copied from interface: HistoryReferencesTableModel
        Returns the entry with the given historyReferenceId. If there is no entry with the given ID null is returned.
        Parameters:
        historyId - the HistoryReference ID of the entry that will be returned
        Returns:
        the entry with the given HistoryReference ID, or null if there is no entry with the given ID
      • addHistoryReference

        public void addHistoryReference​(HistoryReference historyReference)
        Convenience method that creates a DefaultHistoryReferencesTableEntry with the given history reference and adds it to the model.
        Parameters:
        historyReference - the history reference that will be added to the model
        See Also:
        DefaultHistoryReferencesTableEntry, HistoryReference
      • removeHistoryReference

        public void removeHistoryReference​(HistoryReference historyReference)
        Convenience method that removes a DefaultHistoryReferencesTableEntry with the given history reference from the model. If the provided HistoryReference is null the function will return without having done anything.
        Parameters:
        historyReference - the history reference that will be removed from the model
        Since:
        2.7.0
        See Also:
        DefaultHistoryReferencesTableEntry, HistoryReference
      • getHistoryReference

        public HistoryReference getHistoryReference​(int historyReferenceId)
        Returns the history reference with the given ID. If the history reference is not found null is returned.
        Parameters:
        historyReferenceId - the ID of the history reference that will be searched
        Returns:
        the history reference, or null if not found