|
||||||||||
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.StoringStockListModel
public class StoringStockListModel
ListModel
for StoringStock
s
Nested Class Summary |
---|
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<StockItem> |
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> |
items
list items |
protected FilterableModel.ModelFilter |
modelFilter
model filter |
protected java.util.List<FilterableModel.ResultCountListener> |
resultCountListener
ResultCountListener list |
protected Stock |
stock
StoringStock source |
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
StoringStockListModel(Stock stock,
DataBasket db,
java.util.Comparator<StockItem> cmp)
default constructor |
|
StoringStockListModel(Stock stock,
DataBasket db,
java.util.Comparator<StockItem> cmp,
boolean categorize,
Category defaultCategory)
constructor |
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 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 |
private void |
fireResultCountChanged(int count)
trigger result count changed event |
java.lang.Object |
getElementAt(int index)
get elemnt at index |
int |
getSize()
get list size |
protected boolean |
isFirstInCategory(int index)
returns true if index is first of its category |
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 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 |
setModelFilter(FilterableModel.ModelFilter modelFilter)
set nre 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 modeled Stock . |
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 Stock stock
StoringStock
source
protected DataBasket db
protected java.util.Comparator<StockItem> cmp
protected java.util.List<java.lang.Object> items
protected java.util.List<FilterableModel.ResultCountListener> resultCountListener
ResultCountListener
list
protected FilterableModel.ModelFilter modelFilter
protected boolean categorize
protected Category defaultCategory
Constructor Detail |
---|
public StoringStockListModel(Stock stock, DataBasket db, java.util.Comparator<StockItem> cmp)
stock
- stock
db
- db
cmp
- cmp
. null for default.public StoringStockListModel(Stock stock, DataBasket db, java.util.Comparator<StockItem> cmp, boolean categorize, Category defaultCategory)
stock
- stock
db
- db
cmp
- cmp
. null for default.categorize
- categorize
defaultCategory
- defaultCategory
. null for default.Method 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()
Stock
is a ListenableStock
,
subscribe as a listener.
subscribe
in interface HelpableListener
public void unsubscribe()
Stock
is a ListenableStock
,
un-subscribe as a listener.
unsubscribe
in interface HelpableListener
protected boolean isFirstInCategory(int index)
index
-
public void updateModel()
Stock
.
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.protected void checkAdd(StockChangeEvent e)
protected void checkRemove(StockChangeEvent e)
protected void checkUpdate(StockChangeEvent e)
public 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)
setModelFilter
in interface FilterableModel
modelFilter
- new model filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |