net.sourceforge.fixagora.excel.client.model
Class ExcelImportTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by net.sourceforge.fixagora.excel.client.model.ExcelImportTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class ExcelImportTableModel
extends javax.swing.table.AbstractTableModel

The Class ExcelImportTableModel.

See Also:
Serialized Form

Nested Class Summary
static class ExcelImportTableModel.EntryStatus
          The Enum EntryStatus.
 
Constructor Summary
ExcelImportTableModel(org.apache.poi.ss.usermodel.Sheet sheet, boolean updateExisting, javax.swing.JTable table, java.util.List<FSecurity> securities)
          Instantiates a new excel import table model.
 
Method Summary
 int getColumnCount()
           
 java.lang.String getColumnName(int column)
           
 java.util.Map<java.lang.Integer,java.lang.String> getColumnTypeMap()
          Gets the column type map.
 int getRowCount()
           
 java.util.List<UploadEntry> getSecurities()
          Gets the securities.
 java.util.Map<java.lang.String,FSecurity> getSecurityIDMap()
          Gets the security id map.
 java.lang.String getStatusText()
          Gets the status text.
 java.util.Map<java.lang.String,FSecurity> getSymbolMap()
          Gets the symbol map.
 ExcelImportTableModel.EntryStatus getUploadStatus(int row)
          Gets the upload status.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isRowDisabled(int rowIndex)
          Checks if is row disabled.
 boolean isUpdateExisting()
          Checks if is update existing.
 boolean isUploading()
          Checks if is uploading.
 void setColumnType(java.lang.String selectedItem, int editingColumn)
          Sets the column type.
 void setUpdateExisting(boolean updateExisting)
          Sets the update existing.
 void setUploadStatus(int row, ExcelImportTableModel.EntryStatus entryStatus)
          Sets the upload status.
 void toggleRow(int editingRow)
          Toggle row.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcelImportTableModel

public ExcelImportTableModel(org.apache.poi.ss.usermodel.Sheet sheet,
                             boolean updateExisting,
                             javax.swing.JTable table,
                             java.util.List<FSecurity> securities)
Instantiates a new excel import table model.

Parameters:
sheet - the sheet
updateExisting - the update existing
table - the table
securities - the securities
Method Detail

getColumnCount

public int getColumnCount()

getColumnName

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

getRowCount

public int getRowCount()

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

setColumnType

public void setColumnType(java.lang.String selectedItem,
                          int editingColumn)
Sets the column type.

Parameters:
selectedItem - the selected item
editingColumn - the editing column

getColumnTypeMap

public java.util.Map<java.lang.Integer,java.lang.String> getColumnTypeMap()
Gets the column type map.

Returns:
the column type map

getStatusText

public java.lang.String getStatusText()
Gets the status text.

Returns:
the status text

toggleRow

public void toggleRow(int editingRow)
Toggle row.

Parameters:
editingRow - the editing row

isRowDisabled

public boolean isRowDisabled(int rowIndex)
Checks if is row disabled.

Parameters:
rowIndex - the row index
Returns:
true, if is row disabled

isUpdateExisting

public boolean isUpdateExisting()
Checks if is update existing.

Returns:
true, if is update existing

setUpdateExisting

public void setUpdateExisting(boolean updateExisting)
Sets the update existing.

Parameters:
updateExisting - the new update existing

getSymbolMap

public java.util.Map<java.lang.String,FSecurity> getSymbolMap()
Gets the symbol map.

Returns:
the symbol map

getSecurityIDMap

public java.util.Map<java.lang.String,FSecurity> getSecurityIDMap()
Gets the security id map.

Returns:
the security id map

getSecurities

public java.util.List<UploadEntry> getSecurities()
Gets the securities.

Returns:
the securities

setUploadStatus

public void setUploadStatus(int row,
                            ExcelImportTableModel.EntryStatus entryStatus)
Sets the upload status.

Parameters:
row - the row
entryStatus - the entry status

getUploadStatus

public ExcelImportTableModel.EntryStatus getUploadStatus(int row)
Gets the upload status.

Parameters:
row - the row
Returns:
the upload status

isUploading

public boolean isUploading()
Checks if is uploading.

Returns:
true, if is uploading