org.opensolaris.opengrok.search.scope
Class HitTableModel

java.lang.Object
  extended by org.opensolaris.opengrok.search.scope.HitTableModel
All Implemented Interfaces:
javax.swing.table.TableModel

public final class HitTableModel
extends java.lang.Object
implements javax.swing.table.TableModel

The HitTableModel is a table-model that gives easy access for the hit data.


Constructor Summary
HitTableModel()
          Creates a new instance of HitTableModel
 
Method Summary
 void addTableModelListener(javax.swing.event.TableModelListener l)
          Add a client
 boolean getAlt(int rowindex)
           
 java.lang.Class getColumnClass(int columnIndex)
          Get the type of class stored in a column
 int getColumnCount()
          Get the number of columns of data
 java.lang.String getColumnName(int columnIndex)
          Get the textual name of a given column
 boolean getDirsep(int rowindex)
           
 Hit getHitAt(int row)
           
 int getRowCount()
          Get the number of rows of data
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Get the value stored in a specific location
 boolean isCellEditable(int rowIndex, int columnIndex)
          Is this cell editable or not.
 boolean more(int i, int j, int session)
           
 void removeTableModelListener(javax.swing.event.TableModelListener l)
          Remove a client
 int search(int session)
           
 void setMaxColumns(int columns)
           
 void setSearchEngine(SearchEngine se)
          Set the searchEngine this TableModel should use
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          Set a value at a given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HitTableModel

public HitTableModel()
Creates a new instance of HitTableModel

Method Detail

setMaxColumns

public void setMaxColumns(int columns)

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
Remove a client

Specified by:
removeTableModelListener in interface javax.swing.table.TableModel
Parameters:
l - the client to remove

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
Add a client

Specified by:
addTableModelListener in interface javax.swing.table.TableModel
Parameters:
l - The client to add

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Set a value at a given position. This is not possible.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Parameters:
aValue - Not used
rowIndex - Not used
columnIndex - Not used

getHitAt

public Hit getHitAt(int row)

getColumnName

public java.lang.String getColumnName(int columnIndex)
Get the textual name of a given column

Specified by:
getColumnName in interface javax.swing.table.TableModel
Parameters:
columnIndex - The column to get the name for
Returns:
The textual name for the coulumn, or null if this is an illegal column index

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Get the type of class stored in a column

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Parameters:
columnIndex - the column to query
Returns:
String

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Is this cell editable or not. None of the cells may be edited

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Parameters:
rowIndex - Not used
columnIndex - Not used
Returns:
false

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Get the value stored in a specific location

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
rowIndex - The row
columnIndex - The column
Returns:
The value stored at (columnIndex, rowIndex) or null if an invalid index is specified

getRowCount

public int getRowCount()
Get the number of rows of data

Specified by:
getRowCount in interface javax.swing.table.TableModel
Returns:
The number of available rows with data

getColumnCount

public int getColumnCount()
Get the number of columns of data

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
The number of columns of data

setSearchEngine

public void setSearchEngine(SearchEngine se)
Set the searchEngine this TableModel should use

Parameters:
se - a SearchEngine object

search

public int search(int session)

more

public boolean more(int i,
                    int j,
                    int session)

getAlt

public boolean getAlt(int rowindex)

getDirsep

public boolean getDirsep(int rowindex)