|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
org.salespointframework.desktop.models.CountingStockListModel
public class CountingStockListModel
ListModel for CountingStocks
| Nested Class Summary | |
|---|---|
static class |
CountingStockListModel.CountingStockListItem
casing class for list items |
| Nested classes/interfaces inherited from interface org.salespointframework.desktop.models.FilterableModel |
|---|
FilterableModel.DefaultModelFilter, FilterableModel.ModelFilter, FilterableModel.ResultCountListener |
| Field Summary | |
|---|---|
protected boolean |
categorize
true, if categories should be displayed |
protected java.util.Comparator<CatalogItem> |
cmp
comparator for sorting |
protected DataBasket |
db
databasket used for visibility |
protected Category |
defaultCategory
category used for items without category |
protected java.util.List<java.lang.Object> |
keys
actual item list. also contains categories |
protected FilterableModel.ModelFilter |
modelFilter
model filter |
protected java.util.List<FilterableModel.ResultCountListener> |
resultCountListeners
result count listener list |
protected boolean |
showZeros
true, if zero count items should be displayed |
protected CountingStock<?,?> |
stock
CountingStock source |
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
CountingStockListModel(CountingStock<StockItem,CatalogItem> stock,
DataBasket db,
java.util.Comparator<CatalogItem> cmp,
boolean showZeros)
constructor |
|
CountingStockListModel(CountingStock<StockItem,CatalogItem> stock,
DataBasket db,
java.util.Comparator<CatalogItem> cmp,
boolean showZeros,
boolean categorize,
Category defaultCategory)
constructor |
|
| Method Summary | |
|---|---|
void |
addedCatalogItem(CatalogChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
addedStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
boolean |
addResultCountListener(FilterableModel.ResultCountListener rcs)
add new ResultCountListener |
void |
canEditCatalogItem(CatalogChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
canEditStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
canRemoveCatalogItem(CatalogChangeEvent 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(java.lang.String sKey)
Internal helper method. |
protected void |
checkRemove(java.lang.String sKey)
Internal helper method. |
protected void |
checkUpdate(java.lang.String sKey)
Internal helper method. |
void |
commitAddStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
commitedAddCatalogItem(CatalogChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
commitEditCatalogItem(CatalogChangeEvent 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 |
commitedRemoveCatalogItem(CatalogChangeEvent 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. |
void |
editingCatalogItem(CatalogChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
editingStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
filterPropertyChanged()
apply new filter an reload items |
private void |
fireResultCountChanged(int count)
trigger result count changed event |
java.lang.Object |
getElementAt(int index)
get element at index |
private int |
getKeyIndex(java.lang.String key)
translates key to index |
int |
getSize()
get list size |
protected boolean |
isFirstInCategory(int index)
|
void |
noEditCatalogItem(CatalogChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
noEditStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
noRemoveCatalogItem(CatalogChangeEvent 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 |
propertyChange(java.beans.PropertyChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
removedCatalogItem(CatalogChangeEvent 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 ResultCountListener |
void |
rollbackAddStockItems(StockChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
rollbackEditCatalogItem(CatalogChangeEvent 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 |
rolledbackAddCatalogItem(CatalogChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
rolledbackRemoveCatalogItem(CatalogChangeEvent e)
Update the internal model and inform any listeners according to the received event. |
void |
setModelFilter(FilterableModel.ModelFilter modelFilter)
sets a new ModelFilter and applies it |
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 modeled CountingStock. |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CountingStock<?,?> stock
CountingStock source
protected DataBasket db
protected java.util.Comparator<CatalogItem> cmp
protected boolean showZeros
protected java.util.List<java.lang.Object> keys
protected java.util.List<FilterableModel.ResultCountListener> resultCountListeners
protected FilterableModel.ModelFilter modelFilter
protected boolean categorize
protected Category defaultCategory
| Constructor Detail |
|---|
public CountingStockListModel(CountingStock<StockItem,CatalogItem> stock,
DataBasket db,
java.util.Comparator<CatalogItem> cmp,
boolean showZeros)
stock - stockdb - dbcmp - cmp. null for defaultshowZeros - showZeros
public CountingStockListModel(CountingStock<StockItem,CatalogItem> stock,
DataBasket db,
java.util.Comparator<CatalogItem> cmp,
boolean showZeros,
boolean categorize,
Category defaultCategory)
stock - stockdb - dbcmp - cmp. null for defaultshowZeros - showZeroscategorize - categorizedefaultCategory - defaultCategory. null for default| Method Detail |
|---|
public java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelpublic int getSize()
getSize in interface javax.swing.ListModelpublic void subscribe()
Catalog is a ListenableCatalog,
subscribe as a listener. If the modelled CountingStock is a ListenableStock, subscribe as
a listener.
subscribe in interface HelpableListenerpublic void unsubscribe()
Catalog is a ListenableCatalog,
un-subscribe as a listener. If the modelled CountingStock is a ListenableStock,
un-subscribe as a listener.
unsubscribe in interface HelpableListenerprotected boolean isFirstInCategory(int index)
public void updateModel()
CountingStock.
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.public void addedCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
addedCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void commitedAddCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
commitedAddCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void rolledbackAddCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
rolledbackAddCatalogItem in interface CatalogChangeListenere - an event object describing the event.
public void canRemoveCatalogItem(CatalogChangeEvent e)
throws VetoException
This method is public as an implementation detail and must not be called directly.
canRemoveCatalogItem in interface CatalogChangeListenere - an event object describing the event.
VetoException - if the listener wants to veto the removal.public void noRemoveCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
noRemoveCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void removedCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
removedCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void commitedRemoveCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
commitedRemoveCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void rolledbackRemoveCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
rolledbackRemoveCatalogItem in interface CatalogChangeListenere - an event object describing the event.
public void canEditCatalogItem(CatalogChangeEvent e)
throws VetoException
This method is public as an implementation detail and must not be called directly.
canEditCatalogItem in interface CatalogChangeListenere - an event object describing the event.
VetoException - if the listener wants to veto the editing.public void noEditCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
noEditCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void editingCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
editingCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void commitEditCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
commitEditCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void rollbackEditCatalogItem(CatalogChangeEvent e)
This method is public as an implementation detail and must not be called directly.
rollbackEditCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void propertyChange(java.beans.PropertyChangeEvent e)
This method is public as an implementation detail and must not be called directly.
propertyChange in interface java.beans.PropertyChangeListenerprivate int getKeyIndex(java.lang.String key)
key -
protected void checkAdd(java.lang.String sKey)
sKey - the key of the added CatalogItemprotected void checkRemove(java.lang.String sKey)
sKey - the key of the removed CatalogItemprotected void checkUpdate(java.lang.String sKey)
sKey - the key of the updated CatalogItempublic 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 dataprivate void fireResultCountChanged(int count)
count - new countpublic boolean addResultCountListener(FilterableModel.ResultCountListener rcs)
ResultCountListener
addResultCountListener in interface FilterableModelpublic void filterPropertyChanged()
filterPropertyChanged in interface FilterableModelpublic void removeResultCountListener(FilterableModel.ResultCountListener rcs)
ResultCountListener
removeResultCountListener in interface FilterableModelpublic void setModelFilter(FilterableModel.ModelFilter modelFilter)
ModelFilter and applies it
setModelFilter in interface FilterableModelmodelFilter - new model filter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||