|
||||||||||
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.CatalogListModel
public class CatalogListModel
ListModel
for Catalogs
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.salespointframework.desktop.models.FilterableModel |
---|
FilterableModel.DefaultModelFilter, FilterableModel.ModelFilter, FilterableModel.ResultCountListener |
Field Summary | |
---|---|
protected Catalog |
catalog
catalog source |
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
processed source content. also contains Category s |
protected FilterableModel.ModelFilter |
modelFilter
applied model filter |
protected java.util.List<FilterableModel.ResultCountListener> |
resultCountListeners
|
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
CatalogListModel(Catalog c,
DataBasket db,
java.util.Comparator<CatalogItem> cmp)
constructor |
|
CatalogListModel(Catalog c,
DataBasket db,
java.util.Comparator<CatalogItem> cmp,
boolean categorize,
Category defaultCategory)
constructor |
Method Summary | |
---|---|
void |
addedCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever a CatalogItem was added to the Catalog. |
boolean |
addResultCountListener(FilterableModel.ResultCountListener rcs)
add a ResultCountListener |
void |
canEditCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called to ask whether a CatalogItem may be edited. |
void |
canRemoveCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called to ask whether a CatalogItem may be removed. |
protected void |
checkAdd(CatalogItem ci)
|
protected void |
checkRemove(CatalogItem ci)
|
protected void |
checkUpdate(CatalogItem ci)
|
void |
commitedAddCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever the adding of a CatalogItem was commited. |
void |
commitEditCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever editing a CatalogItem was commited. |
void |
commitedRemoveCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever the removal of a CatalogItem was commited. |
void |
DatasourceChanged(boolean pumpUp)
datasource changed. reload all items |
void |
editingCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever editing a CatalogItem was started. |
void |
filterPropertyChanged()
apply new filter and reload items |
protected void |
fireResultCountChanged(int count)
trigger result count changed event to all registered listeners |
java.lang.Object |
getElementAt(int index)
get element at index |
int |
getSize()
get element count |
protected boolean |
isFirstInCategory(int index)
checks if the index is the first in category |
void |
noEditCatalogItem(CatalogChangeEvent<CatalogItem> e)
z Called for each listener that already agreed with an editing that was then rejected by another listener. |
void |
noRemoveCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called for each listener that already agreed with a removal that was then rejected by another listener. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
removedCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever a CatalogItem was removed from the Catalog. |
void |
removeResultCountListener(FilterableModel.ResultCountListener rcs)
remove a ResultCountListener |
void |
rollbackEditCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever editing a CatalogItem was rolled back. |
void |
rolledbackAddCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever the adding of a CatalogItem was rolled back. |
void |
rolledbackRemoveCatalogItem(CatalogChangeEvent<CatalogItem> e)
Called whenever the removal of a CatalogItem was rolled back. |
void |
setModelFilter(FilterableModel.ModelFilter modelFilter)
set ModelFilter and apply it |
void |
subscribe()
Called when the listener should subscribe to its own event source. |
void |
unsubscribe()
Called when the listener should unsubscribe from its own event source. |
void |
updateModel()
updates the model and applies filters, ordering and categories |
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 Catalog catalog
protected DataBasket db
protected java.util.Comparator<CatalogItem> cmp
protected java.util.List<java.lang.Object> keys
Category
s
protected java.util.List<FilterableModel.ResultCountListener> resultCountListeners
protected FilterableModel.ModelFilter modelFilter
protected boolean categorize
protected Category defaultCategory
Constructor Detail |
---|
public CatalogListModel(Catalog c, DataBasket db, java.util.Comparator<CatalogItem> cmp)
c
- catalog
db
- db
cmp
- cmp
. null for default comparatorpublic CatalogListModel(Catalog c, DataBasket db, java.util.Comparator<CatalogItem> cmp, boolean categorize, Category defaultCategory)
c
- catalog
db
- db
cmp
- cmp
. null for default comparatorcategorize
- categorize
defaultCategory
- defaultCategory
. null for default.Method Detail |
---|
public void addedCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
addedCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.addedCatalogItem(CatalogChangeEvent)
public void canEditCatalogItem(CatalogChangeEvent<CatalogItem> e) throws VetoException
CatalogChangeListener
noEditCatalogItem
event.
canEditCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.
VetoException
- if the listener wants to veto the editing.CatalogTableModel.canEditCatalogItem(CatalogChangeEvent)
public void canRemoveCatalogItem(CatalogChangeEvent<CatalogItem> e) throws VetoException
CatalogChangeListener
noRemoveCatalogItem
event.
canRemoveCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.
VetoException
- if the listener wants to veto the removal.CatalogTableModel.canRemoveCatalogItem(CatalogChangeEvent)
public void commitEditCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
commitEditCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.commitEditCatalogItem(CatalogChangeEvent)
public void commitedAddCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
commitedAddCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.commitedAddCatalogItem(CatalogChangeEvent)
public void commitedRemoveCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
commitedRemoveCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.commitedRemoveCatalogItem(CatalogChangeEvent)
public void editingCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
removedCatalogItem
and a addedCatalogItem
event, but this is implementation
specific.
editingCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.public void noEditCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
noEditCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.noEditCatalogItem(CatalogChangeEvent)
public void noRemoveCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
noRemoveCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.noRemoveCatalogItem(CatalogChangeEvent)
public void removedCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
removedCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.removedCatalogItem(CatalogChangeEvent)
public void rollbackEditCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
rollbackEditCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.rollbackEditCatalogItem(CatalogChangeEvent)
public void rolledbackAddCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
rolledbackAddCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.rolledbackAddCatalogItem(CatalogChangeEvent)
public void rolledbackRemoveCatalogItem(CatalogChangeEvent<CatalogItem> e)
CatalogChangeListener
rolledbackRemoveCatalogItem
in interface CatalogChangeListener<CatalogItem>
e
- an event object describing the event.CatalogTableModel.rolledbackRemoveCatalogItem(CatalogChangeEvent)
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 datapublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
CatalogTableModel.propertyChange(PropertyChangeEvent)
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()
HelpableListener
subscribe
in interface HelpableListener
CatalogTableModel.subscribe()
public void unsubscribe()
HelpableListener
unsubscribe
in interface HelpableListener
CatalogTableModel.unsubscribe()
public void updateModel()
updateModel
in interface HelpableListener
protected boolean isFirstInCategory(int index)
index
-
protected void checkAdd(CatalogItem ci)
CatalogTableModel.checkAdd(CatalogItem)
protected void checkRemove(CatalogItem ci)
CatalogTableModel.checkRemove(CatalogItem)
protected void checkUpdate(CatalogItem ci)
CatalogTableModel.checkUpdate(CatalogItem)
public 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 apply it
setModelFilter
in interface FilterableModel
modelFilter
- new model filterprotected void fireResultCountChanged(int count)
count
- new count
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |