Class PropertyTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- com.inductiveautomation.factorypmi.designer.property.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 Summary
Fields Modifier and Type Field Description protected static java.util.Comparator<java.beans.FeatureDescriptor>
alphabeticalComparator
protected java.lang.Object
bean
protected java.beans.BeanDescriptor
beanDescriptor
protected java.util.List
beans
static int
COL_NAME
static int
COL_VALUE
protected int
currentFilter
protected java.beans.FeatureDescriptor[]
descriptors
protected static boolean
editorsRegistered
protected MultiBeanInfo
info
protected boolean
multiObject
protected static DescriptorComparator
naturalComparator
protected static int
NUM_COLUMNS
protected java.util.Hashtable<java.lang.Class,java.beans.PropertyEditor>
propEditors
Cached property editors.static int
SORT_ALPHABETICAL
static int
SORT_NATURAL
static int
SORT_TYPE
protected int
sortOrder
protected static java.util.Comparator<java.beans.FeatureDescriptor>
typeComparator
static int
VIEW_ALL
static int
VIEW_BOUND
static int
VIEW_CONSTRAINED
static int
VIEW_EXPERT
static int
VIEW_HIDDEN
static int
VIEW_PREFERRED
static int
VIEW_READ_ONLY
static int
VIEW_STANDARD
-
Constructor Summary
Constructors Constructor Description PropertyTableModel(VisionDesignerImpl fpmi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
filterTable(int view)
Filters the table to display only properties with specific attributes.int
getColumnCount()
Get column count (2: name, value)DesignerContext
getContext()
java.lang.Class
getCustomEditorClass(int row)
java.awt.Component
getCustomizer()
Gets the customizer for the current object.int
getFilter()
Returns the current filter typejava.lang.Object
getObject()
Return the current object that is represented by this model.VisionDesignerImpl
getObjectHolder()
java.beans.FeatureDescriptor
getPropertyDescriptor(int row)
Returns the PropertyDescriptor for the row.java.beans.PropertyEditor
getPropertyEditor(int row)
Returns a new instance of the property editor for a given class.java.lang.Class
getPropertyType(int row)
Returns the Java type info for the property at the given row.int
getRowCount()
Get row count (total number of properties shown)int
getSortOrder()
java.lang.Object
getValueAt(int row, int col)
Get text value for cell of tableboolean
hasCustomizer()
Returns a flag indicating if the encapsulated object has a customizer.boolean
isCellEditable(int row, int col)
Check if given cell is editableboolean
isRowCustomEditor(int row)
void
reloadBean()
void
setFilter(int filter)
Sets the current filter of the Properties.void
setMultiObject(java.util.List beans)
void
setObject(java.lang.Object bean)
Set the table model to represents the properties of the object.void
setSortOrder(int sort)
Sets the current sort order on the datavoid
setValueAt(java.lang.Object value, int row, int column)
Set the value of the property at rowrow
for the selected bean (or beans)void
sortTable(int sort)
Sorts the table according to the sort type.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
multiObject
protected boolean multiObject
-
descriptors
protected java.beans.FeatureDescriptor[] descriptors
-
beanDescriptor
protected java.beans.BeanDescriptor beanDescriptor
-
info
protected MultiBeanInfo info
-
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
-
naturalComparator
protected static DescriptorComparator naturalComparator
-
alphabeticalComparator
protected static java.util.Comparator<java.beans.FeatureDescriptor> alphabeticalComparator
-
typeComparator
protected static java.util.Comparator<java.beans.FeatureDescriptor> typeComparator
-
NUM_COLUMNS
protected static final int NUM_COLUMNS
- See Also:
- Constant Field Values
-
COL_NAME
public static final int COL_NAME
- See Also:
- Constant Field Values
-
COL_VALUE
public static final int COL_VALUE
- See Also:
- Constant Field Values
-
VIEW_ALL
public static final int VIEW_ALL
- See Also:
- Constant Field Values
-
VIEW_STANDARD
public static final int VIEW_STANDARD
- See Also:
- Constant Field Values
-
VIEW_EXPERT
public static final int VIEW_EXPERT
- See Also:
- Constant Field Values
-
VIEW_READ_ONLY
public static final int VIEW_READ_ONLY
- See Also:
- Constant Field Values
-
VIEW_BOUND
public static final int VIEW_BOUND
- See Also:
- Constant Field Values
-
VIEW_CONSTRAINED
public static final int VIEW_CONSTRAINED
- See Also:
- Constant Field Values
-
VIEW_HIDDEN
public static final int VIEW_HIDDEN
- See Also:
- Constant Field Values
-
VIEW_PREFERRED
public static final int VIEW_PREFERRED
- See Also:
- Constant Field Values
-
currentFilter
protected int currentFilter
-
SORT_NATURAL
public static final int SORT_NATURAL
- See Also:
- Constant Field Values
-
SORT_ALPHABETICAL
public static final int SORT_ALPHABETICAL
- See Also:
- Constant Field Values
-
SORT_TYPE
public static final int SORT_TYPE
- See Also:
- Constant Field Values
-
sortOrder
protected int sortOrder
-
-
Constructor Detail
-
PropertyTableModel
public PropertyTableModel(VisionDesignerImpl fpmi)
-
-
Method Detail
-
getObjectHolder
public VisionDesignerImpl getObjectHolder()
-
getContext
public DesignerContext getContext()
-
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 interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.AbstractTableModel
- Parameters:
row
- table rowcol
- table column
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
Get text value for cell of table- Parameters:
row
- table rowcol
- table column
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int column)
Set the value of the property at rowrow
for the selected bean (or beans)- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in classjavax.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.
-
-