org.apache.directory.server.core.partition.impl.btree.gui
Class AttributesTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.apache.directory.server.core.partition.impl.btree.gui.AttributesTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class AttributesTableModel
extends javax.swing.table.AbstractTableModel

A general purpose table model for entry attributes.

Version:
$Rev: 655126 $
Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
static java.lang.String KEY_COL
          name for the key column
static java.lang.String VAL_COL
          name for the values column
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AttributesTableModel(ServerEntry entry, java.lang.Long id, java.lang.String dn, boolean isMutable)
          Creates a table model for entry attributes.
 
Method Summary
 void delete(int row)
          Deletes a row within the table model.
 java.lang.Class<java.lang.String> getColumnClass(int c)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 java.lang.String getEntryDn()
          Gets the distinguished name of the entry.
 java.lang.Long getEntryId()
          Gets the unique id for the entry.
 int getRowCount()
           
 java.lang.Object getValueAt(int row, int col)
           
 void insert(int row, java.lang.Object key, java.lang.Object val)
          Inserts an attribute key/value into the table model.
 boolean isCellEditable(int row, int col)
           
 void setValue(java.lang.Object val, int row, int col)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_COL

public static final java.lang.String KEY_COL
name for the key column

See Also:
Constant Field Values

VAL_COL

public static final java.lang.String VAL_COL
name for the values column

See Also:
Constant Field Values
Constructor Detail

AttributesTableModel

public AttributesTableModel(ServerEntry entry,
                            java.lang.Long id,
                            java.lang.String dn,
                            boolean isMutable)
Creates a table model for entry attributes.

Parameters:
entry - the entry to create a model for
id - the id for the entry
dn - the distinguished name of the entry
isMutable - whether or not the model can be changed
Method Detail

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
See Also:
AbstractTableModel.getColumnName(int)

getRowCount

public int getRowCount()
See Also:
TableModel.getRowCount()

getColumnCount

public int getColumnCount()
See Also:
TableModel.getColumnCount()

getColumnClass

public java.lang.Class<java.lang.String> getColumnClass(int c)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
See Also:
AbstractTableModel.getColumnClass(int)

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
See Also:
AbstractTableModel.isCellEditable(int, int)

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
See Also:
TableModel.getValueAt(int, int)

setValue

public void setValue(java.lang.Object val,
                     int row,
                     int col)
See Also:
AbstractTableModel.setValueAt(Object, int, int)

getEntryDn

public java.lang.String getEntryDn()
Gets the distinguished name of the entry.

Returns:
the distinguished name of the entry

getEntryId

public java.lang.Long getEntryId()
Gets the unique id for the entry.

Returns:
the unique id for the entry

delete

public void delete(int row)
Deletes a row within the table model.

Parameters:
row - the row index to delete

insert

public void insert(int row,
                   java.lang.Object key,
                   java.lang.Object val)
Inserts an attribute key/value into the table model.

Parameters:
row - the row index to insert into
key - the key of the attr to insert
val - the value of the attr to insert


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.