com.togethersoft.openapi.ide.inspector.util.table
Class PropertyTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--com.togethersoft.openapi.ide.inspector.util.table.PropertyTableModelBase
              |
              +--com.togethersoft.openapi.ide.inspector.util.table.PropertyTableModel

public class PropertyTableModel
extends PropertyTableModelBase
implements PropertyChangeListener

Represents default implementation of PropertyTableModel. This TableModel is listener for property change event so it can iteract with it's visual representation in order to synchronize changes.

Author:
TogetherSoft

Fields inherited from class javax.swing.table.AbstractTableModel
listenerList

Constructor Summary
PropertyTableModel(IdeInspectorPropertySetComponent inspectorPropertySetComponent)
           Constructs this table model from the existing InspectorPropertySetComponent.
PropertyTableModel(IdeInspectorPropertySetComponent inspectorPropertySetComponent, int valueColumn)
           Constructs this table model from the existing InspectorPropertySetComponent.

Method Summary
 static IdeInspectorPropertyextractIdeInspectorPropertyFromModel(TableModel tableModel, int row, int column)
           There can be different table models so this method can be overwritten in PropertyValueEditor subclasses.
 intgetColumnCount()
           Returns count of ths columns.
 IdeInspectorPropertygetInspectorProperty(int row, int column)
           Fetches InspectorProperty from this table model.
 protected IdeInspectorProperty[]getPropertySetProperties()
           Returns array of all properties.
 intgetRowCount()
           Returns count of rows.
 ObjectgetValueAt(int i, int j)
           Fetches value of the certain property.
 booleanisCellEditable(int row, int column)
           Checks whether certain cell is editable.
 voidpropertyChange(PropertyChangeEvent e)
           Synchronize this table model with changes in UI representation.
 protected voidsetPropertySetProperties(IdeInspectorProperty[] properties)
           Specifies new table model contents from existing array of InspectorProperties.
 voidsetValueAt(Object obj, int i, int j)
           Sets new value to the certain property.

Methods inherited from class com.togethersoft.openapi.ide.inspector.util.table.PropertyTableModelBase
getPropertyEditor, getPropertyType

Methods inherited from class javax.swing.table.AbstractTableModel
getColumnName, findColumn, getColumnClass, addTableModelListener, removeTableModelListener, fireTableDataChanged, fireTableStructureChanged, fireTableRowsInserted, fireTableRowsUpdated, fireTableRowsDeleted, fireTableCellUpdated, fireTableChanged, getListeners

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize

Constructor Detail

PropertyTableModel

public PropertyTableModel(IdeInspectorPropertySetComponent inspectorPropertySetComponent)
Constructs this table model from the existing InspectorPropertySetComponent. This table will have only one column.
Parameters:
inspectorPropertySetComponent - Source for this table model

PropertyTableModel

public PropertyTableModel(IdeInspectorPropertySetComponent inspectorPropertySetComponent, int valueColumn)
Constructs this table model from the existing InspectorPropertySetComponent.
Parameters:
inspectorPropertySetComponent - Source for this table model
valueColumn - Number of columns to be in this table model
Method Detail

extractIdeInspectorPropertyFromModel

public static IdeInspectorProperty extractIdeInspectorPropertyFromModel(TableModel tableModel, int row, int column)
There can be different table models so this method can be overwritten in PropertyValueEditor subclasses. Note that column parameter is model's parameter (not table's).

getColumnCount

public int getColumnCount()
Returns count of ths columns.
Returns: this table model has 2 columns - property name and value, so this method always returns 2.

getInspectorProperty

public IdeInspectorProperty getInspectorProperty(int row, int column)
Fetches InspectorProperty from this table model.
Parameters:
row - Row number in this table model
column - Column number in this table model
Returns: IdeInspectorProperty or null if column is illegal

getPropertySetProperties

protected IdeInspectorProperty[] getPropertySetProperties()
Returns array of all properties.

getRowCount

public int getRowCount()
Returns count of rows.
Returns: count of rows, or zero if there are no properties

getValueAt

public Object getValueAt(int i, int j)
Fetches value of the certain property.
Returns: Value, or null if property is nit readable

isCellEditable

public boolean isCellEditable(int row, int column)
Checks whether certain cell is editable.
Returns: true - if so, false - if not or property is null

propertyChange

public void propertyChange(PropertyChangeEvent e)
Synchronize this table model with changes in UI representation. Does nothing if properties are not visible.

setPropertySetProperties

protected void setPropertySetProperties(IdeInspectorProperty[] properties)
Specifies new table model contents from existing array of InspectorProperties.

setValueAt

public void setValueAt(Object obj, int i, int j)
Sets new value to the certain property. Does nothing if column number is illegal, or property is not writeable.

Association Links

to Class com.togethersoft.openapi.ide.inspector.IdeInspectorPropertySetComponent

to Class com.togethersoft.openapi.ide.inspector.IdeInspectorProperty