Class PropertyTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.inductiveautomation.factorypmi.designer.property.PropertyTableModel
- All Implemented Interfaces:
Serializable,TableModel
- Direct Known Subclasses:
SimplifiedPropertyTableModel
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Comparator<FeatureDescriptor>protected Objectprotected BeanDescriptorprotected Liststatic final intstatic final intprotected intprotected FeatureDescriptor[]protected static booleanprotected MultiBeanInfoprotected booleanprotected static DescriptorComparatorprotected static final intprotected Hashtable<Class,PropertyEditor> Cached property editors.static final intstatic final intstatic final intprotected intprotected static Comparator<FeatureDescriptor>static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfilterTable(int view) Filters the table to display only properties with specific attributes.intGet column count (2: name, value)getCustomEditorClass(int row) Gets the customizer for the current object.intReturns the current filter typeReturn the current object that is represented by this model.getPropertyDescriptor(int row) Returns the PropertyDescriptor for the row.getPropertyEditor(int row) Returns a new instance of the property editor for a given class.getPropertyType(int row) Returns the Java type info for the property at the given row.intGet row count (total number of properties shown)intgetValueAt(int row, int col) Get text value for cell of tablebooleanReturns a flag indicating if the encapsulated object has a customizer.booleanisCellEditable(int row, int col) Check if given cell is editablebooleanisRowCustomEditor(int row) voidvoidsetFilter(int filter) Sets the current filter of the Properties.voidsetMultiObject(List beans) voidSet the table model to represents the properties of the object.voidsetSortOrder(int sort) Sets the current sort order on the datavoidsetValueAt(Object value, int row, int column) Set the value of the property at rowrowfor the selected bean (or beans)voidsortTable(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 Details
-
multiObject
protected boolean multiObject -
descriptors
-
beanDescriptor
-
info
-
bean
-
beans
-
propEditors
Cached property editors. -
editorsRegistered
protected static boolean editorsRegistered -
naturalComparator
-
alphabeticalComparator
-
typeComparator
-
NUM_COLUMNS
protected static final int NUM_COLUMNS- See Also:
-
COL_NAME
public static final int COL_NAME- See Also:
-
COL_VALUE
public static final int COL_VALUE- See Also:
-
VIEW_ALL
public static final int VIEW_ALL- See Also:
-
VIEW_STANDARD
public static final int VIEW_STANDARD- See Also:
-
VIEW_EXPERT
public static final int VIEW_EXPERT- See Also:
-
VIEW_READ_ONLY
public static final int VIEW_READ_ONLY- See Also:
-
VIEW_BOUND
public static final int VIEW_BOUND- See Also:
-
VIEW_CONSTRAINED
public static final int VIEW_CONSTRAINED- See Also:
-
VIEW_HIDDEN
public static final int VIEW_HIDDEN- See Also:
-
VIEW_PREFERRED
public static final int VIEW_PREFERRED- See Also:
-
currentFilter
protected int currentFilter -
SORT_NATURAL
public static final int SORT_NATURAL- See Also:
-
SORT_ALPHABETICAL
public static final int SORT_ALPHABETICAL- See Also:
-
SORT_TYPE
public static final int SORT_TYPE- See Also:
-
sortOrder
protected int sortOrder
-
-
Constructor Details
-
PropertyTableModel
-
-
Method Details
-
getObjectHolder
-
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
Set the table model to represents the properties of the object. -
setMultiObject
-
reloadBean
public void reloadBean() -
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:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel- Parameters:
row- table rowcol- table column
-
getValueAt
Get text value for cell of table- Parameters:
row- table rowcol- table column
-
setValueAt
Set the value of the property at rowrowfor the selected bean (or beans)- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
getPropertyType
Returns the Java type info for the property at the given row. -
getPropertyDescriptor
Returns the PropertyDescriptor for the row. -
isRowCustomEditor
public boolean isRowCustomEditor(int row) -
getCustomEditorClass
-
getPropertyEditor
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
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.
-