|
SalesPoint Framework v3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdata.filters.CatalogFilter
A filter for Catalogs.
CatalogFilters can be used to present partial views of a Catalog to parts of your application, e.g., GUI elements. However, you cannot use a CatalogFilter as a replacement for a 'real' Catalog, e.g., as an item in another Catalog.
The actual filter condition is defined by overriding method match(data.CatalogItem).
| Field Summary | |
protected Catalog |
m_cOrg
The Catalog that is being filtered. |
protected ListenerHelper |
m_lhListeners
The listeners that listen for events from this Catalog. |
| Fields inherited from interface data.CatalogItem |
VALUE_PROPERTY |
| Fields inherited from interface data.Nameable |
NAME_PROPERTY |
| Constructor Summary | |
CatalogFilter(Catalog cOrg)
Create a new CatalogFilter. |
|
| Method Summary | |
void |
add(CatalogItem ci,
DataBasket db)
Add the given item to the source Catalog. |
void |
addCatalogChangeListener(CatalogChangeListener ccl)
Add a listener that wishes to receive events when the filtered Catalog changes. |
void |
addedCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
addNameListener(PropertyChangeListener pcl)
Register the listener with the source Catalog. |
void |
addPropertyChangeListener(PropertyChangeListener pcl)
Register the listener with the source Catalog. |
void |
addValueListener(PropertyChangeListener pcl)
Register the listener with the source Catalog. |
NameContext |
attach(NameContext nc)
Attach the given name context to the source Catalog. |
void |
canEditCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
canRemoveCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
commitedAddCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
commitEditCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
commitedRemoveCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
int |
compareTo(Object o)
Compare the source Catalog to the given object. |
boolean |
contains(String sKey,
DataBasket db)
Check whether the indicated item is contained in the filtered Catalog. |
NameContext |
detachNC()
Detach the current name context from the source Catalog. |
void |
editingCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
protected void |
fireCanEditCatalogItem(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCanRemoveCatalogItem(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemAddCommit(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemAdded(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemAddRollback(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemRemoveCommit(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemRemoved(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemRemoveRollback(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCommitEditCatalogItem(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireEditingCatalogItem(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireNoEditCatalogItem(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireNoRemoveCatalogItem(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireRollbackEditCatalogItem(CatalogItem ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
CatalogItem |
get(String sKey,
DataBasket db,
boolean fForEdit)
Get the indicated item from the source Catalog if it is contained in the filtered Catalog. |
Catalog |
getCatalog()
Get the source Catalog's Catalog. |
Catalog |
getMainCatalog()
Get the source catalog. |
String |
getName()
Get the source Catalog's name. |
Value |
getValue()
Get the source Catalog's value. |
Iterator |
iterator(DataBasket db,
boolean fForEdit)
Get an iterator of all items that are contained in the filtered Catalog. |
Set |
keySet(DataBasket db)
Return a set that contains all keys for which a CatalogItem is contained in the filtered Catalog. |
protected abstract boolean |
match(CatalogItem ci)
Filter condition. |
void |
noEditCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
noRemoveCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
CatalogItem |
remove(CatalogItem ci,
DataBasket db)
Remove the given item from the source Catalog if it is contained in the filtered Catalog. |
CatalogItem |
remove(String sKey,
DataBasket db)
Remove the given item from the source Catalog if it is contained in the filtered Catalog. |
void |
removeCatalogChangeListener(CatalogChangeListener ccl)
Remove a listener that received events when the filtered Catalog changed. |
void |
removedCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
removeNameListener(PropertyChangeListener pcl)
Un-Register the listener with the source Catalog. |
void |
removePropertyChangeListener(PropertyChangeListener pcl)
Un-Register the listener with the source Catalog. |
void |
removeValueListener(PropertyChangeListener pcl)
Un-Register the listener with the source Catalog. |
void |
rollbackEditCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
rolledbackAddCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
rolledbackRemoveCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog. |
void |
setName(String sName,
DataBasket db)
Set the source Catalog's name. |
int |
size(DataBasket db)
Calculate the size of the filtered Catalog. |
void |
subscribe()
Subscribe as a listener to the source Catalog if that is a ListenableCatalog. |
void |
unsubscribe()
Un-Subscribe as a listener from the source Catalog if that is a ListenableCatalog. |
void |
updateModel()
Empty method body. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Catalog m_cOrg
protected ListenerHelper m_lhListeners
| Constructor Detail |
public CatalogFilter(Catalog cOrg)
cOrg - the Catalog to be filtered.| Method Detail |
public int compareTo(Object o)
compareTo in interface Comparablepublic NameContext detachNC()
detachNC in interface Nameablepublic NameContext attach(NameContext nc)
attach in interface Nameablenc - the new NameContext of this Nameable object.
public String getName()
getName in interface Nameable
public void setName(String sName,
DataBasket db)
throws NameContextException
setName in interface NameablesName - the new name of the objectdb - the DataBasket relative to which the operation is to be performed.
NameContextException - if the name change was not approved of by the NameContext.NameContextpublic Value getValue()
getValue in interface CatalogItempublic void addPropertyChangeListener(PropertyChangeListener pcl)
addPropertyChangeListener in interface Nameablepublic void removePropertyChangeListener(PropertyChangeListener pcl)
removePropertyChangeListener in interface Nameablepublic void addNameListener(PropertyChangeListener pcl)
addNameListener in interface Nameablepublic void removeNameListener(PropertyChangeListener pcl)
removeNameListener in interface Nameablepublic void addValueListener(PropertyChangeListener pcl)
addValueListener in interface CatalogItempublic void removeValueListener(PropertyChangeListener pcl)
removeValueListener in interface CatalogItempublic Catalog getCatalog()
getCatalog in interface CatalogItempublic Catalog getMainCatalog()
public void add(CatalogItem ci,
DataBasket db)
add in interface Catalogci - the CatalogItem to be added. This item must not be contained in another Catalog.db - the DataBasket relative to which the operation is to be performed.
public CatalogItem remove(CatalogItem ci,
DataBasket db)
throws VetoException
remove in interface Catalogci - the CatalogItem to be removed.db - the DataBasket relative to which the operation is to be performed.
VetoException - if one of the listeners vetos the removal.
public CatalogItem remove(String sKey,
DataBasket db)
throws VetoException
remove in interface CatalogsKey - the key of the CatalogItem to be removed.db - the DataBasket relative to which the operation is to be performed.
VetoException - if one of the listeners vetos the removal.
public CatalogItem get(String sKey,
DataBasket db,
boolean fForEdit)
throws VetoException
get in interface CatalogsKey - the key of the CatalogItem to be retrieved.db - the DataBasket relative to which the operation is to be performed.fForEdit - if true, the CatalogItem will be retrieved for editing.
VetoException - if one of the listeners vetos the editing.
public boolean contains(String sKey,
DataBasket db)
contains in interface CatalogsKey - the key for which to check containment.db - the DataBasket that defines visibility of items. See Catalog.add(data.CatalogItem, data.DataBasket) and Catalog.remove(data.CatalogItem, data.DataBasket) for
details on visibility.
public Iterator iterator(DataBasket db,
boolean fForEdit)
iterator in interface Catalogdb - the DataBasket that defines visibility.fForEdit - if true, the items are retrieved for editing. VetoException will be converted into
UnsupportedOperationExceptions.public Set keySet(DataBasket db)
keySet in interface Catalogdb - the DataBasket used to determine visibility of elements.public int size(DataBasket db)
size in interface Catalogdb - the DataBasket used to determine visibility.protected abstract boolean match(CatalogItem ci)
ci - the item to be tested
public void addedCatalogItem(CatalogChangeEvent e)
addedCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void commitedAddCatalogItem(CatalogChangeEvent e)
commitedAddCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void rolledbackAddCatalogItem(CatalogChangeEvent e)
rolledbackAddCatalogItem in interface CatalogChangeListenere - an event object describing the event.
public void canRemoveCatalogItem(CatalogChangeEvent e)
throws VetoException
canRemoveCatalogItem in interface CatalogChangeListenere - an event object describing the event.
VetoException - if the listener wants to veto the removal.public void noRemoveCatalogItem(CatalogChangeEvent e)
noRemoveCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void removedCatalogItem(CatalogChangeEvent e)
removedCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void commitedRemoveCatalogItem(CatalogChangeEvent e)
commitedRemoveCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void rolledbackRemoveCatalogItem(CatalogChangeEvent e)
rolledbackRemoveCatalogItem in interface CatalogChangeListenere - an event object describing the event.
public void canEditCatalogItem(CatalogChangeEvent e)
throws VetoException
canEditCatalogItem in interface CatalogChangeListenere - an event object describing the event.
VetoException - if the listener wants to veto the editing.public void noEditCatalogItem(CatalogChangeEvent e)
noEditCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void editingCatalogItem(CatalogChangeEvent e)
editingCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void commitEditCatalogItem(CatalogChangeEvent e)
commitEditCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void rollbackEditCatalogItem(CatalogChangeEvent e)
rollbackEditCatalogItem in interface CatalogChangeListenere - an event object describing the event.public void addCatalogChangeListener(CatalogChangeListener ccl)
addCatalogChangeListener in interface ListenableCatalogccl - the listener to be added.public void removeCatalogChangeListener(CatalogChangeListener ccl)
removeCatalogChangeListener in interface ListenableCatalogccl - the listener to be removed.
protected void fireCatalogItemAdded(CatalogItem ci,
DataBasket db)
protected void fireCatalogItemAddCommit(CatalogItem ci,
DataBasket db)
protected void fireCatalogItemAddRollback(CatalogItem ci,
DataBasket db)
protected void fireCatalogItemRemoved(CatalogItem ci,
DataBasket db)
protected void fireCatalogItemRemoveCommit(CatalogItem ci,
DataBasket db)
protected void fireCatalogItemRemoveRollback(CatalogItem ci,
DataBasket db)
protected void fireCanRemoveCatalogItem(CatalogItem ci,
DataBasket db)
throws VetoException
VetoException
protected void fireNoRemoveCatalogItem(CatalogItem ci,
DataBasket db)
protected void fireCanEditCatalogItem(CatalogItem ci,
DataBasket db)
throws VetoException
VetoException
protected void fireNoEditCatalogItem(CatalogItem ci,
DataBasket db)
protected void fireEditingCatalogItem(CatalogItem ci,
DataBasket db)
protected void fireCommitEditCatalogItem(CatalogItem ci,
DataBasket db)
protected void fireRollbackEditCatalogItem(CatalogItem ci,
DataBasket db)
public void subscribe()
ListenableCatalog.
subscribe in interface HelpableListenerpublic void unsubscribe()
ListenableCatalog.
unsubscribe in interface HelpableListenerpublic void updateModel()
updateModel in interface HelpableListener
|
SalesPoint Framework v3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||