|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object data.filters.CatalogFilter<T>
public abstract class CatalogFilter<T extends CatalogItem>
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(T)
.
Field Summary | |
---|---|
protected Catalog<T> |
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<T> cOrg)
Create a new CatalogFilter. |
Method Summary | |
---|---|
void |
add(T 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<T> 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<T> e)
Translate and propagate the event to all listeners of this Catalog. |
void |
canRemoveCatalogItem(CatalogChangeEvent<T> e)
Translate and propagate the event to all listeners of this Catalog. |
void |
commitedAddCatalogItem(CatalogChangeEvent<T> e)
Translate and propagate the event to all listeners of this Catalog. |
void |
commitEditCatalogItem(CatalogChangeEvent<T> e)
Translate and propagate the event to all listeners of this Catalog. |
void |
commitedRemoveCatalogItem(CatalogChangeEvent<T> 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<T> e)
Translate and propagate the event to all listeners of this Catalog. |
protected void |
fireCanEditCatalogItem(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCanRemoveCatalogItem(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemAddCommit(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemAdded(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemAddRollback(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemRemoveCommit(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemRemoved(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCatalogItemRemoveRollback(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireCommitEditCatalogItem(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireEditingCatalogItem(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireNoEditCatalogItem(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireNoRemoveCatalogItem(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
protected void |
fireRollbackEditCatalogItem(T ci,
DataBasket db)
Fire the event to all listeners of this Catalog. |
T |
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<T> |
iterator(DataBasket db,
boolean fForEdit)
Get an iterator of all items that are contained in the filtered Catalog. |
Set<String> |
keySet(DataBasket db)
Return a set that contains all keys for which a CatalogItem is contained in the filtered Catalog. |
protected abstract boolean |
match(T ci)
Filter condition. |
void |
noEditCatalogItem(CatalogChangeEvent<T> e)
Translate and propagate the event to all listeners of this Catalog. |
void |
noRemoveCatalogItem(CatalogChangeEvent<T> e)
Translate and propagate the event to all listeners of this Catalog. |
T |
remove(String sKey,
DataBasket db)
Remove the given item from the source Catalog if it is contained in the filtered Catalog. |
T |
remove(T ci,
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<T> 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<T> e)
Translate and propagate the event to all listeners of this Catalog. |
void |
rolledbackAddCatalogItem(CatalogChangeEvent<T> e)
Translate and propagate the event to all listeners of this Catalog. |
void |
rolledbackRemoveCatalogItem(CatalogChangeEvent<T> 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<T extends CatalogItem> m_cOrg
protected ListenerHelper m_lhListeners
Constructor Detail |
---|
public CatalogFilter(Catalog<T> cOrg)
cOrg
- the Catalog to be filtered.Method Detail |
---|
public int compareTo(Object o)
compareTo
in interface Comparable<Object>
public NameContext detachNC()
detachNC
in interface Nameable
public NameContext attach(NameContext nc)
attach
in interface Nameable
nc
- 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 Nameable
sName
- 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.NameContext
public Value getValue()
getValue
in interface CatalogItem
public void addPropertyChangeListener(PropertyChangeListener pcl)
addPropertyChangeListener
in interface Nameable
public void removePropertyChangeListener(PropertyChangeListener pcl)
removePropertyChangeListener
in interface Nameable
public void addNameListener(PropertyChangeListener pcl)
addNameListener
in interface Nameable
public void removeNameListener(PropertyChangeListener pcl)
removeNameListener
in interface Nameable
public void addValueListener(PropertyChangeListener pcl)
addValueListener
in interface CatalogItem
public void removeValueListener(PropertyChangeListener pcl)
removeValueListener
in interface CatalogItem
public Catalog getCatalog()
getCatalog
in interface CatalogItem
public Catalog getMainCatalog()
public void add(T ci, DataBasket db)
add
in interface Catalog<T extends CatalogItem>
ci
- 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 T remove(T ci, DataBasket db) throws VetoException
remove
in interface Catalog<T extends CatalogItem>
ci
- 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 T remove(String sKey, DataBasket db) throws VetoException
remove
in interface Catalog<T extends CatalogItem>
sKey
- 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 T get(String sKey, DataBasket db, boolean fForEdit) throws VetoException
get
in interface Catalog<T extends CatalogItem>
sKey
- 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 Catalog<T extends CatalogItem>
sKey
- the key for which to check containment.db
- the DataBasket that defines visibility of items. See Catalog.add(T, data.DataBasket)
and Catalog.remove(T, data.DataBasket)
for
details on visibility.public Iterator<T> iterator(DataBasket db, boolean fForEdit)
iterator
in interface Catalog<T extends CatalogItem>
db
- the DataBasket that defines visibility.fForEdit
- if true, the items are retrieved for editing. VetoException will be converted into
UnsupportedOperationException
s.public Set<String> keySet(DataBasket db)
keySet
in interface Catalog<T extends CatalogItem>
db
- the DataBasket used to determine visibility of elements.public int size(DataBasket db)
size
in interface Catalog<T extends CatalogItem>
db
- the DataBasket used to determine visibility.protected abstract boolean match(T ci)
ci
- the item to be tested
public void addedCatalogItem(CatalogChangeEvent<T> e)
addedCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void commitedAddCatalogItem(CatalogChangeEvent<T> e)
commitedAddCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void rolledbackAddCatalogItem(CatalogChangeEvent<T> e)
rolledbackAddCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void canRemoveCatalogItem(CatalogChangeEvent<T> e) throws VetoException
canRemoveCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.
VetoException
- if the listener wants to veto the removal.public void noRemoveCatalogItem(CatalogChangeEvent<T> e)
noRemoveCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void removedCatalogItem(CatalogChangeEvent<T> e)
removedCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void commitedRemoveCatalogItem(CatalogChangeEvent<T> e)
commitedRemoveCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void rolledbackRemoveCatalogItem(CatalogChangeEvent<T> e)
rolledbackRemoveCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void canEditCatalogItem(CatalogChangeEvent<T> e) throws VetoException
canEditCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.
VetoException
- if the listener wants to veto the editing.public void noEditCatalogItem(CatalogChangeEvent<T> e)
noEditCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void editingCatalogItem(CatalogChangeEvent<T> e)
editingCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void commitEditCatalogItem(CatalogChangeEvent<T> e)
commitEditCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void rollbackEditCatalogItem(CatalogChangeEvent<T> e)
rollbackEditCatalogItem
in interface CatalogChangeListener<T extends CatalogItem>
e
- an event object describing the event.public void addCatalogChangeListener(CatalogChangeListener ccl)
addCatalogChangeListener
in interface ListenableCatalog<T extends CatalogItem>
ccl
- the listener to be added.public void removeCatalogChangeListener(CatalogChangeListener ccl)
removeCatalogChangeListener
in interface ListenableCatalog<T extends CatalogItem>
ccl
- the listener to be removed.protected void fireCatalogItemAdded(T ci, DataBasket db)
protected void fireCatalogItemAddCommit(T ci, DataBasket db)
protected void fireCatalogItemAddRollback(T ci, DataBasket db)
protected void fireCatalogItemRemoved(T ci, DataBasket db)
protected void fireCatalogItemRemoveCommit(T ci, DataBasket db)
protected void fireCatalogItemRemoveRollback(T ci, DataBasket db)
protected void fireCanRemoveCatalogItem(T ci, DataBasket db) throws VetoException
VetoException
protected void fireNoRemoveCatalogItem(T ci, DataBasket db)
protected void fireCanEditCatalogItem(T ci, DataBasket db) throws VetoException
VetoException
protected void fireNoEditCatalogItem(T ci, DataBasket db)
protected void fireEditingCatalogItem(T ci, DataBasket db)
protected void fireCommitEditCatalogItem(T ci, DataBasket db)
protected void fireRollbackEditCatalogItem(T ci, DataBasket db)
public void subscribe()
ListenableCatalog
.
subscribe
in interface HelpableListener
public void unsubscribe()
ListenableCatalog
.
unsubscribe
in interface HelpableListener
public void updateModel()
updateModel
in interface HelpableListener
|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |