Class PropertyTableModel

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.table.TableModel
    Direct Known Subclasses:
    SimplifiedPropertyTableModel

    public class PropertyTableModel
    extends javax.swing.table.AbstractTableModel

    Table model used to obtain property names and values. This model encapsulates an array of PropertyDescriptors.

    This is the old property table model from the old bean builder base. It it still used in the classic chart customizer. See PropertyTableModel for the new property table that is used in the actual property editor pane.

    See Also:
    Serialized Form
    • Field Detail

      • multiObject

        protected boolean multiObject
      • descriptors

        protected java.beans.FeatureDescriptor[] descriptors
      • beanDescriptor

        protected java.beans.BeanDescriptor beanDescriptor
      • bean

        protected java.lang.Object bean
      • beans

        protected java.util.List beans
      • propEditors

        protected java.util.Hashtable<java.lang.Class,​java.beans.PropertyEditor> propEditors
        Cached property editors.
      • editorsRegistered

        protected static boolean editorsRegistered
      • alphabeticalComparator

        protected static java.util.Comparator<java.beans.FeatureDescriptor> alphabeticalComparator
      • typeComparator

        protected static java.util.Comparator<java.beans.FeatureDescriptor> typeComparator
      • currentFilter

        protected int currentFilter
      • sortOrder

        protected int sortOrder
    • Method Detail

      • setFilter

        public void setFilter​(int filter)
        Sets the current filter of the Properties.
        Parameters:
        filter - one of VIEW_ constants
      • getFilter

        public int getFilter()
        Returns the current filter type
      • setSortOrder

        public void setSortOrder​(int sort)
        Sets the current sort order on the data
        Parameters:
        sort - one of the SORT_ constants
      • getSortOrder

        public int getSortOrder()
      • setObject

        public void setObject​(java.lang.Object bean)
        Set the table model to represents the properties of the object.
      • setMultiObject

        public void setMultiObject​(java.util.List beans)
      • reloadBean

        public void reloadBean()
      • getObject

        public java.lang.Object getObject()
        Return the current object that is represented by this model.
      • getRowCount

        public int getRowCount()
        Get row count (total number of properties shown)
      • getColumnCount

        public int getColumnCount()
        Get column count (2: name, value)
      • isCellEditable

        public boolean isCellEditable​(int row,
                                      int col)
        Check if given cell is editable
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.AbstractTableModel
        Parameters:
        row - table row
        col - table column
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           int col)
        Get text value for cell of table
        Parameters:
        row - table row
        col - table column
      • setValueAt

        public void setValueAt​(java.lang.Object value,
                               int row,
                               int column)
        Set the value of the property at row row for the selected bean (or beans)
        Specified by:
        setValueAt in interface javax.swing.table.TableModel
        Overrides:
        setValueAt in class javax.swing.table.AbstractTableModel
      • getPropertyType

        public java.lang.Class getPropertyType​(int row)
        Returns the Java type info for the property at the given row.
      • getPropertyDescriptor

        public java.beans.FeatureDescriptor getPropertyDescriptor​(int row)
        Returns the PropertyDescriptor for the row.
      • isRowCustomEditor

        public boolean isRowCustomEditor​(int row)
      • getCustomEditorClass

        public java.lang.Class getCustomEditorClass​(int row)
      • getPropertyEditor

        public java.beans.PropertyEditor getPropertyEditor​(int row)
        Returns a new instance of the property editor for a given class. If an editor is not specified in the property descriptor then it is looked up in the PropertyEditorManager.
      • hasCustomizer

        public boolean hasCustomizer()
        Returns a flag indicating if the encapsulated object has a customizer.
      • getCustomizer

        public java.awt.Component getCustomizer()
        Gets the customizer for the current object.
        Returns:
        New instance of the customizer or null if there isn't a customizer.
      • sortTable

        public void sortTable​(int sort)
        Sorts the table according to the sort type.
      • filterTable

        public void filterTable​(int view)
        Filters the table to display only properties with specific attributes. Will sort the table after the data has been filtered.
        Parameters:
        view - The properties to display.