SalesPoint Framework v3.0

data.filters
Class CatalogFilter

java.lang.Object
  |
  +--data.filters.CatalogFilter
Direct Known Subclasses:
CurrencyFilter

public abstract class CatalogFilter
extends Object
implements Catalog, CatalogChangeListener, ListenableCatalog, HelpableListener

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).

Hooks:
Define Catalog Filter
Since:
v2.0
Version:
2.0 19/08/1999
Author:
Steffen Zschaler
See Also:
Serialized Form

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.
 
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

m_cOrg

protected Catalog m_cOrg
The Catalog that is being filtered.

m_lhListeners

protected ListenerHelper m_lhListeners
The listeners that listen for events from this Catalog.
Constructor Detail

CatalogFilter

public CatalogFilter(Catalog cOrg)
Create a new CatalogFilter.
Parameters:
cOrg - the Catalog to be filtered.
Method Detail

compareTo

public int compareTo(Object o)
Compare the source Catalog to the given object.
Override:
Never.

detachNC

public NameContext detachNC()
Detach the current name context from the source Catalog.
Override:
Never.

attach

public NameContext attach(NameContext nc)
Attach the given name context to the source Catalog.
Override:
Never.

getName

public String getName()
Get the source Catalog's name.
Override:
Never.

setName

public void setName(String sName,
                    DataBasket db)
             throws NameContextException
Set the source Catalog's name.
Override:
Never.

getValue

public Value getValue()
Get the source Catalog's value.
Override:
Never.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener pcl)
Register the listener with the source Catalog.
Override:
Never.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener pcl)
Un-Register the listener with the source Catalog.
Override:
Never.

addNameListener

public void addNameListener(PropertyChangeListener pcl)
Register the listener with the source Catalog.
Override:
Never.

removeNameListener

public void removeNameListener(PropertyChangeListener pcl)
Un-Register the listener with the source Catalog.
Override:
Never.

addValueListener

public void addValueListener(PropertyChangeListener pcl)
Register the listener with the source Catalog.
Override:
Never.

removeValueListener

public void removeValueListener(PropertyChangeListener pcl)
Un-Register the listener with the source Catalog.
Override:
Never.

getCatalog

public Catalog getCatalog()
Get the source Catalog's Catalog.
Override:
Never.

getMainCatalog

public Catalog getMainCatalog()
Get the source catalog. If the source catalog is a CatalogFilter again, return this Catalog's MainCatalog.
Override:
Never.

add

public void add(CatalogItem ci,
                DataBasket db)
Add the given item to the source Catalog.
Override:
Never.
Specified by:
add in interface Catalog

remove

public CatalogItem remove(CatalogItem ci,
                          DataBasket db)
                   throws VetoException
Remove the given item from the source Catalog if it is contained in the filtered Catalog.
Override:
Never.
Specified by:
remove in interface Catalog

remove

public CatalogItem remove(String sKey,
                          DataBasket db)
                   throws VetoException
Remove the given item from the source Catalog if it is contained in the filtered Catalog.
Override:
Never.
Specified by:
remove in interface Catalog

get

public CatalogItem get(String sKey,
                       DataBasket db,
                       boolean fForEdit)
                throws VetoException
Get the indicated item from the source Catalog if it is contained in the filtered Catalog.
Override:
Never.
Specified by:
get in interface Catalog

contains

public boolean contains(String sKey,
                        DataBasket db)
Check whether the indicated item is contained in the filtered Catalog.
Override:
Never.
Specified by:
contains in interface Catalog

iterator

public Iterator iterator(DataBasket db,
                         boolean fForEdit)
Get an iterator of all items that are contained in the filtered Catalog.
Override:
Never.
Specified by:
iterator in interface Catalog

keySet

public Set keySet(DataBasket db)
Return a set that contains all keys for which a CatalogItem is contained in the filtered Catalog.
Override:
Never.
Specified by:
keySet in interface Catalog

size

public int size(DataBasket db)
Calculate the size of the filtered Catalog.
Override:
Never.
Specified by:
size in interface Catalog

match

protected abstract boolean match(CatalogItem ci)
Filter condition.
Override:
Always.
Parameters:
ci - the item to be tested
Returns:
true if the given item shall be an item of the filtered Catalog.
Hooks:
Define Catalog Filter , Define Currency Filter

addedCatalogItem

public void addedCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
addedCatalogItem in interface CatalogChangeListener

commitedAddCatalogItem

public void commitedAddCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
commitedAddCatalogItem in interface CatalogChangeListener

rolledbackAddCatalogItem

public void rolledbackAddCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
rolledbackAddCatalogItem in interface CatalogChangeListener

canRemoveCatalogItem

public void canRemoveCatalogItem(CatalogChangeEvent e)
                          throws VetoException
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
canRemoveCatalogItem in interface CatalogChangeListener

noRemoveCatalogItem

public void noRemoveCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
noRemoveCatalogItem in interface CatalogChangeListener

removedCatalogItem

public void removedCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
removedCatalogItem in interface CatalogChangeListener

commitedRemoveCatalogItem

public void commitedRemoveCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
commitedRemoveCatalogItem in interface CatalogChangeListener

rolledbackRemoveCatalogItem

public void rolledbackRemoveCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
rolledbackRemoveCatalogItem in interface CatalogChangeListener

canEditCatalogItem

public void canEditCatalogItem(CatalogChangeEvent e)
                        throws VetoException
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
canEditCatalogItem in interface CatalogChangeListener

noEditCatalogItem

public void noEditCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
noEditCatalogItem in interface CatalogChangeListener

editingCatalogItem

public void editingCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
editingCatalogItem in interface CatalogChangeListener

commitEditCatalogItem

public void commitEditCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
commitEditCatalogItem in interface CatalogChangeListener

rollbackEditCatalogItem

public void rollbackEditCatalogItem(CatalogChangeEvent e)
Translate and propagate the event to all listeners of this Catalog.
Override:
Never.
Specified by:
rollbackEditCatalogItem in interface CatalogChangeListener

addCatalogChangeListener

public void addCatalogChangeListener(CatalogChangeListener ccl)
Add a listener that wishes to receive events when the filtered Catalog changes.
Override:
Never.
Specified by:
addCatalogChangeListener in interface ListenableCatalog

removeCatalogChangeListener

public void removeCatalogChangeListener(CatalogChangeListener ccl)
Remove a listener that received events when the filtered Catalog changed.
Override:
Never.
Specified by:
removeCatalogChangeListener in interface ListenableCatalog

fireCatalogItemAdded

protected void fireCatalogItemAdded(CatalogItem ci,
                                    DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireCatalogItemAddCommit

protected void fireCatalogItemAddCommit(CatalogItem ci,
                                        DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireCatalogItemAddRollback

protected void fireCatalogItemAddRollback(CatalogItem ci,
                                          DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireCatalogItemRemoved

protected void fireCatalogItemRemoved(CatalogItem ci,
                                      DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireCatalogItemRemoveCommit

protected void fireCatalogItemRemoveCommit(CatalogItem ci,
                                           DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireCatalogItemRemoveRollback

protected void fireCatalogItemRemoveRollback(CatalogItem ci,
                                             DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireCanRemoveCatalogItem

protected void fireCanRemoveCatalogItem(CatalogItem ci,
                                        DataBasket db)
                                 throws VetoException
Fire the event to all listeners of this Catalog.
Override:
Never.

fireNoRemoveCatalogItem

protected void fireNoRemoveCatalogItem(CatalogItem ci,
                                       DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireCanEditCatalogItem

protected void fireCanEditCatalogItem(CatalogItem ci,
                                      DataBasket db)
                               throws VetoException
Fire the event to all listeners of this Catalog.
Override:
Never.

fireNoEditCatalogItem

protected void fireNoEditCatalogItem(CatalogItem ci,
                                     DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireEditingCatalogItem

protected void fireEditingCatalogItem(CatalogItem ci,
                                      DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireCommitEditCatalogItem

protected void fireCommitEditCatalogItem(CatalogItem ci,
                                         DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

fireRollbackEditCatalogItem

protected void fireRollbackEditCatalogItem(CatalogItem ci,
                                           DataBasket db)
Fire the event to all listeners of this Catalog.
Override:
Never.

subscribe

public void subscribe()
Subscribe as a listener to the source Catalog if that is a ListenableCatalog.
Override:
Never.
Specified by:
subscribe in interface HelpableListener

unsubscribe

public void unsubscribe()
Un-Subscribe as a listener from the source Catalog if that is a ListenableCatalog.
Override:
Never.
Specified by:
unsubscribe in interface HelpableListener

updateModel

public void updateModel()
Empty method body.
Override:
Never.
Specified by:
updateModel in interface HelpableListener

SalesPoint Framework v3.0