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.AbstractTableModelTable 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
PropertyTableModelfor 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>alphabeticalComparatorprotected java.lang.Objectbeanprotected java.beans.BeanDescriptorbeanDescriptorprotected java.util.Listbeansstatic intCOL_NAMEstatic intCOL_VALUEprotected intcurrentFilterprotected java.beans.FeatureDescriptor[]descriptorsprotected static booleaneditorsRegisteredprotected MultiBeanInfoinfoprotected booleanmultiObjectprotected static DescriptorComparatornaturalComparatorprotected static intNUM_COLUMNSprotected java.util.Hashtable<java.lang.Class,java.beans.PropertyEditor>propEditorsCached property editors.static intSORT_ALPHABETICALstatic intSORT_NATURALstatic intSORT_TYPEprotected intsortOrderprotected static java.util.Comparator<java.beans.FeatureDescriptor>typeComparatorstatic intVIEW_ALLstatic intVIEW_BOUNDstatic intVIEW_CONSTRAINEDstatic intVIEW_EXPERTstatic intVIEW_HIDDENstatic intVIEW_PREFERREDstatic intVIEW_READ_ONLYstatic intVIEW_STANDARD
-
Constructor Summary
Constructors Constructor Description PropertyTableModel(VisionDesignerImpl fpmi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilterTable(int view)Filters the table to display only properties with specific attributes.intgetColumnCount()Get column count (2: name, value)DesignerContextgetContext()java.lang.ClassgetCustomEditorClass(int row)java.awt.ComponentgetCustomizer()Gets the customizer for the current object.intgetFilter()Returns the current filter typejava.lang.ObjectgetObject()Return the current object that is represented by this model.VisionDesignerImplgetObjectHolder()java.beans.FeatureDescriptorgetPropertyDescriptor(int row)Returns the PropertyDescriptor for the row.java.beans.PropertyEditorgetPropertyEditor(int row)Returns a new instance of the property editor for a given class.java.lang.ClassgetPropertyType(int row)Returns the Java type info for the property at the given row.intgetRowCount()Get row count (total number of properties shown)intgetSortOrder()java.lang.ObjectgetValueAt(int row, int col)Get text value for cell of tablebooleanhasCustomizer()Returns a flag indicating if the encapsulated object has a customizer.booleanisCellEditable(int row, int col)Check if given cell is editablebooleanisRowCustomEditor(int row)voidreloadBean()voidsetFilter(int filter)Sets the current filter of the Properties.voidsetMultiObject(java.util.List beans)voidsetObject(java.lang.Object bean)Set the table model to represents the properties of the object.voidsetSortOrder(int sort)Sets the current sort order on the datavoidsetValueAt(java.lang.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 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:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein 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 rowrowfor the selected bean (or beans)- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin 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.
-
-