站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

TableInfoModel (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore.util.table
Class TableInfoModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.netbeans.modules.vcscore.util.table.TableInfoModel
All Implemented Interfaces:
Comparator, Serializable, TableModel

public class TableInfoModel
extends AbstractTableModel
implements Comparator

Table model that translates @{link List} to 2D table structure. Translation logic is based on reflection and defined by setColumnDefinition(int, java.lang.String, java.lang.reflect.Method, boolean, org.netbeans.modules.vcscore.util.table.TableInfoComparator) methods.

See Also:
Serialized Form

Field Summary
static int ASCENDING
           
protected  HashMap columnComparators
           
protected  HashMap columnLabels
           
protected  HashMap columnSorted
           
protected  HashMap columnToolTipSetters
           
protected  HashMap columnValueParams
           
protected  HashMap columnValueSetters
           
static int DESCENDING
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableInfoModel()
          Creates memory based implemnation.
TableInfoModel(int estimatedSize)
          Creates new tarnslating table model
 
Method Summary
 void addElement(Object object)
           
 void clear()
           
 int compare(Object obj1, Object obj2)
           
 boolean equals(Object obj)
           
 void fireTableDataChanged()
           
 int getActiveColumn()
           
 int getColumnCount()
           
 String getColumnName(int param)
           
 int getDirection()
           
 Object getElementAt(int row)
           
 int getElementRow(Object element)
           
 List getList()
           
 int getRowCount()
           
 String getTooltipTextAt(int row, int column)
          Get the tooltip text at the given position.
 Object getValueAt(int row, int column)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isColumnSortable(int column)
           
 void prependElement(Object object)
           
 boolean removeElement(Object object)
           
 void setActiveColumn(int index)
           
 void setColumnDefinition(int columnNumber, String label, Method reflectionGetter, boolean sorted, TableInfoComparator comp)
           
 void setColumnDefinition(int columnNumber, String label, Method reflectionGetter, Object[] params, boolean sorted, TableInfoComparator comp)
           
 void setColumnToolTipGetter(int columnNumber, Method reflectionGetter)
           
 void setDirection(boolean ascending)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASCENDING

public static final int ASCENDING
See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
See Also:
Constant Field Values

columnLabels

protected HashMap columnLabels

columnValueSetters

protected HashMap columnValueSetters

columnValueParams

protected HashMap columnValueParams

columnSorted

protected HashMap columnSorted

columnComparators

protected HashMap columnComparators

columnToolTipSetters

protected HashMap columnToolTipSetters
Constructor Detail

TableInfoModel

public TableInfoModel()
Creates memory based implemnation.


TableInfoModel

public TableInfoModel(int estimatedSize)
Creates new tarnslating table model

Parameters:
estimatedSize - helps implementation to decide about backend data storage: memory vs. file. The higher value the higher chance that implementation chooses file based list.
Method Detail

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Specified by:
getValueAt in interface TableModel

getTooltipTextAt

public String getTooltipTextAt(int row,
                               int column)
Get the tooltip text at the given position.

Returns:
The tooltip text or null.

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel

getColumnName

public String getColumnName(int param)
Specified by:
getColumnName in interface TableModel

isColumnSortable

public boolean isColumnSortable(int column)

getElementAt

public Object getElementAt(int row)

getElementRow

public int getElementRow(Object element)

setColumnDefinition

public void setColumnDefinition(int columnNumber,
                                String label,
                                Method reflectionGetter,
                                boolean sorted,
                                TableInfoComparator comp)

setColumnDefinition

public void setColumnDefinition(int columnNumber,
                                String label,
                                Method reflectionGetter,
                                Object[] params,
                                boolean sorted,
                                TableInfoComparator comp)

setColumnToolTipGetter

public void setColumnToolTipGetter(int columnNumber,
                                   Method reflectionGetter)

addElement

public void addElement(Object object)

fireTableDataChanged

public void fireTableDataChanged()

removeElement

public boolean removeElement(Object object)

clear

public void clear()

prependElement

public void prependElement(Object object)

setActiveColumn

public void setActiveColumn(int index)

getActiveColumn

public int getActiveColumn()

setDirection

public void setDirection(boolean ascending)

getDirection

public int getDirection()

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator

compare

public int compare(Object obj1,
                   Object obj2)
Specified by:
compare in interface Comparator

getList

public List getList()

 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.