webfunds.client
Class ReceiptTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--webfunds.client.ReceiptTableModel

public class ReceiptTableModel
extends javax.swing.table.AbstractTableModel

Table model for WebFunds Transactions. Can be applied to an account, or to an account/contract pair.

See Also:
Serialized Form

Field Summary
protected  boolean showCancels
          If set to true, show the cancel payments
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ReceiptTableModel(AccountInfo account, ChangeContractStore cs)
          For a complete account (of many contract subaccounts).
ReceiptTableModel(AccountInfo account, Contract contract)
          For a subaccount - account/contract pair.
ReceiptTableModel(AccountInfo account, ItemId item)
          For a subaccount - account/contract pair.
ReceiptTableModel(WalletInterface wi, ChangeContractStore cs)
          For a whole wallet - unused.
 
Method Summary
 int findColumn(java.lang.String colname)
           
 java.lang.Class getColumnClass(int column)
          Find out what class is stored in the given column.
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 int getRowCount()
           
 boolean getShowCancels()
           
 Transaction getTransaction(int row)
           
 java.lang.Object getValueAt(int row, int column)
           
 void refresh(AccountInfo info)
          Refresh with new information taken from the account info.
 void refresh(AccountInfo info, Contract contract)
          Refresh with new information taken from the subaccount info/contract.
 void refresh(AccountInfo info, ItemId item)
          Refresh with new information taken from the subaccount info/item.
 void refresh(WalletInterface wi)
          Refresh with new information taken from the walllet.
 void setShowCancels(boolean show)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showCancels

protected boolean showCancels
If set to true, show the cancel payments
Constructor Detail

ReceiptTableModel

public ReceiptTableModel(WalletInterface wi,
                         ChangeContractStore cs)
For a whole wallet - unused.

ReceiptTableModel

public ReceiptTableModel(AccountInfo account,
                         ChangeContractStore cs)
For a complete account (of many contract subaccounts).

ReceiptTableModel

public ReceiptTableModel(AccountInfo account,
                         Contract contract)
For a subaccount - account/contract pair.

ReceiptTableModel

public ReceiptTableModel(AccountInfo account,
                         ItemId item)
For a subaccount - account/contract pair. This call is used where the contract is not available or or is unknown for some reason, but, as there exists a subaccount, it must be displayed properly, albeit with less information.
Method Detail

getShowCancels

public boolean getShowCancels()

setShowCancels

public void setShowCancels(boolean show)

getRowCount

public int getRowCount()
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel

getColumnCount

public int getColumnCount()
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel

getColumnName

public java.lang.String getColumnName(int col)
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

findColumn

public int findColumn(java.lang.String colname)
Overrides:
findColumn in class javax.swing.table.AbstractTableModel

getColumnClass

public java.lang.Class getColumnClass(int column)
Find out what class is stored in the given column.
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Throws:
java.lang.IllegalArgumentException - if column is out of range

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel
Throws:
java.lang.IllegalArgumentException - if row or column is out of range

getTransaction

public Transaction getTransaction(int row)
Throws:
java.lang.IllegalArgumentException - if row is out of range

refresh

public void refresh(WalletInterface wi)
Refresh with new information taken from the walllet.

refresh

public void refresh(AccountInfo info)
Refresh with new information taken from the account info.

refresh

public void refresh(AccountInfo info,
                    ItemId item)
Refresh with new information taken from the subaccount info/item.

refresh

public void refresh(AccountInfo info,
                    Contract contract)
Refresh with new information taken from the subaccount info/contract.