| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
org.salespointframework.desktop.models.AbstractTableModel
org.salespointframework.desktop.models.StoringStockTableModel
public class StoringStockTableModel
A TableModel that models the contents of a Stock, representing each
 StockItem as an individual record.
| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from interface org.salespointframework.desktop.models.FilterableModel | 
|---|
FilterableModel.DefaultModelFilter, FilterableModel.ModelFilter, FilterableModel.ResultCountListener | 
| Field Summary | |
|---|---|
protected  java.util.Comparator<StockItem> | 
m_cmpComparator
The Comparator that defines the sorting order of records in the model.  | 
protected  DataBasket | 
m_dbBasket
The DataBasket used to determine visibility.  | 
protected  java.util.List<StockItem> | 
m_lItems
The internal model.  | 
protected  Stock | 
m_stModel
The Stock that is being modelled.  | 
protected  FilterableModel.ModelFilter | 
modelFilter
model filter  | 
protected  java.util.List<FilterableModel.ResultCountListener> | 
resultCountListeners
result count listener list  | 
| Fields inherited from class javax.swing.table.AbstractTableModel | 
|---|
listenerList | 
| Constructor Summary | |
|---|---|
StoringStockTableModel(Stock st,
                       DataBasket db,
                       java.util.Comparator<StockItem> cmp,
                       TableEntryDescriptor ted)
Create a new StoringStockTableModel.  | 
|
| Method Summary | |
|---|---|
 void | 
addedStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 boolean | 
addResultCountListener(FilterableModel.ResultCountListener rcs)
add a FilterableModel.ResultCountListener | 
 void | 
canEditStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
canRemoveStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
protected  void | 
checkAdd(StockChangeEvent e)
Internal helper method.  | 
protected  void | 
checkRemove(StockChangeEvent e)
Internal helper method.  | 
protected  void | 
checkUpdate(StockChangeEvent e)
Internal helper method.  | 
 void | 
commitAddStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
commitEditStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
commitRemoveStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
DatasourceChanged(boolean pumpUp)
The datasource changed. force the model to invalidate its internal structures and pump up the event  | 
 void | 
editingStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
filterPropertyChanged()
apply filter and reload items  | 
 java.lang.Object | 
getRecord(int row)
Get the record at the given index.  | 
 int | 
getRowCount()
Get the number of records in this model.  | 
 void | 
noEditStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
noRemoveStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
removedStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
removeResultCountListener(FilterableModel.ResultCountListener rcs)
remove FilterableModel.ResultCountListener | 
 void | 
rollbackAddStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
rollbackEditStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
rollbackRemoveStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event.  | 
 void | 
setData(java.lang.Object n_stModel)
Set the table's data.  | 
 void | 
setModelFilter(FilterableModel.ModelFilter modelFilter)
set new model filter and reload items  | 
 void | 
subscribe()
Subscribe as a listener to the model.  | 
 void | 
unsubscribe()
Un-Subscribe as a listener from the model.  | 
 void | 
updateModel()
Update the internal model based on the modelled Stock. | 
| Methods inherited from class org.salespointframework.desktop.models.AbstractTableModel | 
|---|
getColumnClass, getColumnCount, getColumnName, getEntryDescriptor, getValueAt, isCellEditable, orderByColumn, reOrderBy, setValueAt | 
| Methods inherited from class javax.swing.table.AbstractTableModel | 
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected Stock m_stModel
protected DataBasket m_dbBasket
protected java.util.Comparator<StockItem> m_cmpComparator
StockItems.
protected java.util.List<FilterableModel.ResultCountListener> resultCountListeners
protected FilterableModel.ModelFilter modelFilter
protected java.util.List<StockItem> m_lItems
| Constructor Detail | 
|---|
public StoringStockTableModel(Stock st,
                              DataBasket db,
                              java.util.Comparator<StockItem> cmp,
                              TableEntryDescriptor ted)
st - the Stock to be modelled.db - the DataBasket to be used to determine visibility.cmp - a Comparator defining the sort order of the records. If null, records are ordered
 according to the natural ordering of the StockItems.ted - a TableEntryDescriptor that can split individual StockItems into a table's cells.| Method Detail | 
|---|
public void setData(java.lang.Object n_stModel)
data.StoringStock
setData in class AbstractTableModeln_stModel - the new datapublic java.lang.Object getRecord(int row)
getRecord in class AbstractTableModelrow - the index for which to retrieve the record. Element of [0, getRowCount()).
StockItem to be displayed at the given index. May return null if
 there is no record at the indicated position.public int getRowCount()
getRowCount in interface javax.swing.table.TableModelpublic void subscribe()
Stock is a ListenableStock,
 subscribe as a listener.
subscribe in interface HelpableListenerpublic void unsubscribe()
Stock is a ListenableStock,
 un-subscribe as a listener.
unsubscribe in interface HelpableListenerpublic void updateModel()
Stock.
updateModel in interface HelpableListenerpublic void addedStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
addedStockItems in interface StockChangeListenere - an event object describing the event.public void commitAddStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
commitAddStockItems in interface StockChangeListenere - an event object describing the event.public void rollbackAddStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
rollbackAddStockItems in interface StockChangeListenere - an event object describing the event.
public void canRemoveStockItems(StockChangeEvent e)
                         throws VetoException
This method is public as an implementation detail and must not be called directly.
canRemoveStockItems in interface StockChangeListenere - an event object describing the event.
VetoException - if the listener wants to veto the removal.public void noRemoveStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
noRemoveStockItems in interface StockChangeListenere - an event object describing the event.public void removedStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
removedStockItems in interface StockChangeListenere - an event object describing the event.public void commitRemoveStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
commitRemoveStockItems in interface StockChangeListenere - an event object describing the event.public void rollbackRemoveStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
rollbackRemoveStockItems in interface StockChangeListenere - an event object describing the event.
public void canEditStockItems(StockChangeEvent e)
                       throws VetoException
This method is public as an implementation detail and must not be called directly.
canEditStockItems in interface StockChangeListenere - an event object describing the event.
VetoException - if the listener wants to veto the editing.public void noEditStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
noEditStockItems in interface StockChangeListenere - an event object describing the event.public void editingStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
editingStockItems in interface StockChangeListenere - an event object describing the event.public void commitEditStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
commitEditStockItems in interface StockChangeListenere - an event object describing the event.public void rollbackEditStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
rollbackEditStockItems in interface StockChangeListenere - an event object describing the event.protected void checkAdd(StockChangeEvent e)
protected void checkRemove(StockChangeEvent e)
protected void checkUpdate(StockChangeEvent e)
public void DatasourceChanged(boolean pumpUp)
DatasourceChanged in interface DatasourceChangeListenerpumpUp - true if the event should be pumped up to hosts, because this event is mostly triggered twice.
 first time to invalidate caches. second time for load new datapublic boolean addResultCountListener(FilterableModel.ResultCountListener rcs)
FilterableModel.ResultCountListener
addResultCountListener in interface FilterableModelpublic void filterPropertyChanged()
filterPropertyChanged in interface FilterableModelpublic void removeResultCountListener(FilterableModel.ResultCountListener rcs)
FilterableModel.ResultCountListener
removeResultCountListener in interface FilterableModelpublic void setModelFilter(FilterableModel.ModelFilter modelFilter)
setModelFilter in interface FilterableModelmodelFilter - new model filter
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||