|
||||||||||
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 CountingStock
s
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
- stock
db
- db
cmp
- 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
- stock
db
- db
cmp
- cmp
. null for defaultshowZeros
- showZeros
categorize
- categorize
defaultCategory
- defaultCategory
. null for defaultMethod Detail |
---|
public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
public int getSize()
getSize
in interface javax.swing.ListModel
public void subscribe()
Catalog
is a ListenableCatalog
,
subscribe as a listener. If the modelled CountingStock
is a ListenableStock
, subscribe as
a listener.
subscribe
in interface HelpableListener
public 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 HelpableListener
protected boolean isFirstInCategory(int index)
public void updateModel()
CountingStock
.
updateModel
in interface HelpableListener
public void addedStockItems(StockChangeEvent e)
This method is public as an implementation detail and must not be called directly.
addedStockItems
in interface StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 StockChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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 CatalogChangeListener
e
- 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.PropertyChangeListener
private 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 DatasourceChangeListener
pumpUp
- 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 FilterableModel
public void filterPropertyChanged()
filterPropertyChanged
in interface FilterableModel
public void removeResultCountListener(FilterableModel.ResultCountListener rcs)
ResultCountListener
removeResultCountListener
in interface FilterableModel
public void setModelFilter(FilterableModel.ModelFilter modelFilter)
ModelFilter
and applies it
setModelFilter
in interface FilterableModel
modelFilter
- new model filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |