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 Object
protected BeanDescriptor
protected List
static final int
static final int
protected int
protected FeatureDescriptor[]
protected static boolean
protected MultiBeanInfo
protected boolean
protected static DescriptorComparator
protected static final int
protected Hashtable<Class,
PropertyEditor> Cached property editors.static final int
static final int
static final int
protected int
protected static Comparator<FeatureDescriptor>
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
filterTable
(int view) Filters the table to display only properties with specific attributes.int
Get column count (2: name, value)getCustomEditorClass
(int row) Gets the customizer for the current object.int
Returns 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.int
Get row count (total number of properties shown)int
getValueAt
(int row, int col) Get text value for cell of tableboolean
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
void
setFilter
(int filter) Sets the current filter of the Properties.void
setMultiObject
(List beans) void
Set the table model to represents the properties of the object.void
setSortOrder
(int sort) Sets the current sort order on the datavoid
setValueAt
(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 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:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in 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 rowrow
for the selected bean (or beans)- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in 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.
-