com.ibm.dse.tools.workbench.gui
Class EntityAttributesTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--javax.swing.table.DefaultTableModel
              |
              +--com.ibm.dse.tools.workbench.gui.EntityAttributesTableModel

public class EntityAttributesTableModel
extends javax.swing.table.DefaultTableModel
implements javax.swing.table.TableModel, TableNames

The implementation of the model of EntitiesAtributes table

See Also:
Serialized Form

Field Summary
protected  java.util.Vector attribRef
           
 java.util.Vector attributes
           
protected static java.lang.String DATA_TYPE_DOMAIN
           
protected static java.lang.String DATA_TYPE_DOMAIN_NAME
           
protected static java.lang.String DATA_TYPE_REFERENCE
           
protected  java.util.Vector dataType
           
protected static TableRow dataTypeDomain
           
protected static java.lang.Object[] dataTypeDomainAllowedValues
           
protected  java.util.Vector defaultValue
           
protected  java.util.Vector domainRef
           
protected static java.lang.Object[] domains
           
protected  TableRow entity
           
protected  java.util.Vector entityRef
           
 int errorRow
           
 int inheritedAttributes
           
 boolean modified
           
 int tableError
           
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Fields inherited from interface com.ibm.dse.tools.workbench.base.TableNames
ALLOWED_VALUES, ATTRIBUTES, DOMAINS, ENTITIES, ENTITIES_ENTITIES, GROUPS, GROUPS_ENTITIES, GROUPS_GROUPS, GROUPS_INSTANCES, INSTANCE_ERRORS, INSTANCES, PROPERTIES, USERS
 
Constructor Summary
EntityAttributesTableModel(TableRow entity, java.awt.Window par)
          EntityAttributesTableModel constructor.
 
Method Summary
 void addAttribute(int index, TableRow attribute)
          This method adds an attribute to the model at position index
 void addAttribute(TableRow attribute)
          This method adds an attribute to the model at position index
 void addAttributes(TableRow[] attributes)
          This method adds an attribute to the model at position index
 void addInheritedAttributes(java.lang.String code)
          This method removes old Inherited Attributes of the table and insert the new ones.
protected  boolean checkValue(java.lang.String value, java.lang.String type)
          This method checks if value is allowed in type.
 void clearValueAt(int row, int column)
          This method clears valuues in row and column indicated
 java.lang.Class getColumnClass(int columnIndex)
          Gets the class of the column columnIndex
 int getColumnCount()
          This method return the number of columns of the model
 java.lang.String getColumnName(int columnIndex)
          This method returns the name of the column
 int getRowCount()
          This method returns the number of rows of the model
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          This method returns the value in posiiton RowIndex and columnIndex
 boolean hasTableErrors()
          This method checks if an error occurred in definition of attributes table, and if it's necessary shows a message.
 boolean isCellEditable(int rowIndex, int columnIndex)
          This method checks if a cell is editable.
 void removeAttribute(int index)
          This method removes index row from the model
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          This methods sets a value at position indicated
 boolean validateEntityRef(TableRow entR)
          This method validates the value (aValue) of the column EntityRef.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_TYPE_DOMAIN

protected static final java.lang.String DATA_TYPE_DOMAIN

DATA_TYPE_REFERENCE

protected static final java.lang.String DATA_TYPE_REFERENCE

DATA_TYPE_DOMAIN_NAME

protected static final java.lang.String DATA_TYPE_DOMAIN_NAME

dataTypeDomain

protected static TableRow dataTypeDomain

dataTypeDomainAllowedValues

protected static java.lang.Object[] dataTypeDomainAllowedValues

domains

protected static java.lang.Object[] domains

entity

protected TableRow entity

inheritedAttributes

public int inheritedAttributes

attributes

public java.util.Vector attributes

entityRef

protected java.util.Vector entityRef

attribRef

protected java.util.Vector attribRef

domainRef

protected java.util.Vector domainRef

defaultValue

protected java.util.Vector defaultValue

dataType

protected java.util.Vector dataType

modified

public boolean modified

tableError

public int tableError

errorRow

public int errorRow
Constructor Detail

EntityAttributesTableModel

public EntityAttributesTableModel(TableRow entity,
                                  java.awt.Window par)
EntityAttributesTableModel constructor.
Method Detail

addAttribute

public void addAttribute(int index,
                         TableRow attribute)
This method adds an attribute to the model at position index
Parameters:
index - int Position of the attribute
attribute - com.ibm.dse.tools.workbench.base.TableRow

addAttribute

public void addAttribute(TableRow attribute)
This method adds an attribute to the model at position index
Parameters:
attribute - com.ibm.dse.tools.workbench.base.TableRow

addAttributes

public void addAttributes(TableRow[] attributes)
This method adds an attribute to the model at position index
Parameters:
attribute - com.ibm.dse.tools.workbench.base.TableRow

addInheritedAttributes

public void addInheritedAttributes(java.lang.String code)
This method removes old Inherited Attributes of the table and insert the new ones.
Parameters:
code - java.lang.String EntityCode to get its attributes.

checkValue

protected boolean checkValue(java.lang.String value,
                             java.lang.String type)
This method checks if value is allowed in type.
Parameters:
code - java.lang.String value
code - java.lang.String type
Returns:
boolean

clearValueAt

public void clearValueAt(int row,
                         int column)
This method clears valuues in row and column indicated
Parameters:
row - int
column - int

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Gets the class of the column columnIndex
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - int.

getColumnCount

public int getColumnCount()
This method return the number of columns of the model
Specified by:
getColumnCount in interface javax.swing.table.TableModel
Overrides:
getColumnCount in class javax.swing.table.DefaultTableModel
Returns:
int

getColumnName

public java.lang.String getColumnName(int columnIndex)
This method returns the name of the column
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.DefaultTableModel
Returns:
java.lang.String

getRowCount

public int getRowCount()
This method returns the number of rows of the model
Specified by:
getRowCount in interface javax.swing.table.TableModel
Overrides:
getRowCount in class javax.swing.table.DefaultTableModel
Returns:
int

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
This method returns the value in posiiton RowIndex and columnIndex
Specified by:
getValueAt in interface javax.swing.table.TableModel
Overrides:
getValueAt in class javax.swing.table.DefaultTableModel
Parameters:
int - rowIndex
int - columnIndex
Returns:
java.lang.Object

hasTableErrors

public boolean hasTableErrors()
This method checks if an error occurred in definition of attributes table, and if it's necessary shows a message.
Returns:
boolean true if has errors, else returns false.

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
This method checks if a cell is editable.
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.DefaultTableModel
Returns:
boolean

removeAttribute

public void removeAttribute(int index)
This method removes index row from the model
Parameters:
int - index

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
This methods sets a value at position indicated
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.DefaultTableModel
Parameters:
java.lang.Object - aValue
int - rowIndex
int - columnIndex

validateEntityRef

public boolean validateEntityRef(TableRow entR)
This method validates the value (aValue) of the column EntityRef.
Parameters:
TableRow - entR Value of the cell, entity to validate.
Returns:
boolean