org.salespointframework.core.data.interfaces
Interface CatalogItem

All Superinterfaces:
java.lang.Comparable<java.lang.Object>, Nameable, SpItem
All Known Subinterfaces:
Catalog<T>, Currency<T>, CurrencyItem, ListenableCatalog<T>
All Known Implementing Classes:
AbstractCurrency, CatalogFilter, CatalogImpl, CatalogItemImpl, CountingStockTableModel.Record, CurrencyFilter, CurrencyImpl, CurrencyItemImpl, EUROCurrencyImpl

public interface CatalogItem
extends Nameable, java.lang.Comparable<java.lang.Object>, SpItem

An item in a Catalog.

CatalogItems describe available objects by their attributes. The only attribute that is mandatory is a key (String), usually a name, but it could be an ID-Number or anything. A CatalogItem can have a value attribute.

Note that the name as obtained via Nameable.getName() is used as the CatalogItem's key when inserting the CatalogItem inside a Catalog.

CatalogItems are contained in Catalogs.

Since:
v0.5
Version:
2.0 18/08/1999
Author:
Steffen Zschaler

Field Summary
static java.lang.String VALUE_PROPERTY
          The programmatical name for the "value" property.
 
Fields inherited from interface org.salespointframework.core.data.interfaces.Nameable
NAME_PROPERTY
 
Method Summary
 void addValueListener(java.beans.PropertyChangeListener pcl)
          Add a PropertyChangeListener that will receive events whenever the "value" property changes.
 void firePropertyChanged()
          Signals persistence layer to update objects values
 Catalog getCatalog()
          Get the Catalog that currently contains this CatalogItem.
 java.awt.image.BufferedImage getImage()
          Get the image of the CatalogItem
 Value getValue()
          Get the default value of this CatalogItem.
 void removeValueListener(java.beans.PropertyChangeListener pcl)
          Remove a PropertyChangeListener for the "value" property.
 boolean setImage(java.net.URI filename)
          Set the image of the CatalogItem
 
Methods inherited from interface org.salespointframework.core.data.interfaces.Nameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.salespointframework.core.data.interfaces.SpItem
getName
 

Field Detail

VALUE_PROPERTY

static final java.lang.String VALUE_PROPERTY
The programmatical name for the "value" property. This is "value".

See Also:
Constant Field Values
Method Detail

getValue

Value getValue()
Get the default value of this CatalogItem. Although CatalogItems have a default value, you can use any other value through the CatalogItemValue adapter.


setImage

boolean setImage(java.net.URI filename)
Set the image of the CatalogItem

Parameters:
filename - uri, pointing to the image file
Returns:
true on success

getImage

java.awt.image.BufferedImage getImage()
Get the image of the CatalogItem

Returns:

getCatalog

Catalog getCatalog()
Get the Catalog that currently contains this CatalogItem.


addValueListener

void addValueListener(java.beans.PropertyChangeListener pcl)
Add a PropertyChangeListener that will receive events whenever the "value" property changes.


removeValueListener

void removeValueListener(java.beans.PropertyChangeListener pcl)
Remove a PropertyChangeListener for the "value" property.


firePropertyChanged

void firePropertyChanged()
Signals persistence layer to update objects values