SalesPoint v3.3 API

data.events
Class CatalogChangeAdapter<T extends CatalogItem>

java.lang.Object
  extended by data.events.CatalogChangeAdapter<T>
All Implemented Interfaces:
CatalogChangeListener<T>, Serializable, EventListener, SerializableListener

public abstract class CatalogChangeAdapter<T extends CatalogItem>
extends Object
implements CatalogChangeListener<T>, SerializableListener

An abstract adapter class for receiving catalog change events. The methods in this class are empty. This class exists as convenience for creating listener objects.

Extend this class to create a CatalogChangeEvent listener and override the methods for the events of interest. (If you implement the CatalogChangeListener interface, you have to define all of the methods in it. This abstract class defines empty method bodies for them all, so you can concentrate on defining methods only for events you care about.)

Create a listener object using the extended class and then register it with a ListenableCatalog using the Catalog's ListenableCatalog.addCatalogChangeListener(data.events.CatalogChangeListener) method. When the Catalog's contents change, the relevant method in the listener object is invoked, and a CatalogChangeEvent is passed to it.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Constructor Summary
CatalogChangeAdapter()
           
 
Method Summary
 void addedCatalogItem(CatalogChangeEvent<T> e)
          Called whenever a CatalogItem was added to the Catalog.
 void canEditCatalogItem(CatalogChangeEvent<T> e)
          Called to ask whether a CatalogItem may be edited.
 void canRemoveCatalogItem(CatalogChangeEvent<T> e)
          Called to ask whether a CatalogItem may be removed.
 void commitedAddCatalogItem(CatalogChangeEvent<T> e)
          Called whenever the adding of a CatalogItem was commited.
 void commitEditCatalogItem(CatalogChangeEvent<T> e)
          Called whenever editing a CatalogItem was commited.
 void commitedRemoveCatalogItem(CatalogChangeEvent<T> e)
          Called whenever the removal of a CatalogItem was commited.
 void editingCatalogItem(CatalogChangeEvent<T> e)
          Called whenever editing a CatalogItem was started.
 void noEditCatalogItem(CatalogChangeEvent<T> e)
          Called for each listener that already agreed with an editing that was then rejected by another listener.
 void noRemoveCatalogItem(CatalogChangeEvent<T> e)
          Called for each listener that already agreed with a removal that was then rejected by another listener.
 void removedCatalogItem(CatalogChangeEvent<T> e)
          Called whenever a CatalogItem was removed from the Catalog.
 void rollbackEditCatalogItem(CatalogChangeEvent<T> e)
          Called whenever editing a CatalogItem was rolled back.
 void rolledbackAddCatalogItem(CatalogChangeEvent<T> e)
          Called whenever the adding of a CatalogItem was rolled back.
 void rolledbackRemoveCatalogItem(CatalogChangeEvent<T> e)
          Called whenever the removal of a CatalogItem was rolled back.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogChangeAdapter

public CatalogChangeAdapter()
Method Detail

addedCatalogItem

public void addedCatalogItem(CatalogChangeEvent<T> e)
Called whenever a CatalogItem was added to the Catalog.

Specified by:
addedCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

commitedAddCatalogItem

public void commitedAddCatalogItem(CatalogChangeEvent<T> e)
Called whenever the adding of a CatalogItem was commited.

Specified by:
commitedAddCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

rolledbackAddCatalogItem

public void rolledbackAddCatalogItem(CatalogChangeEvent<T> e)
Called whenever the adding of a CatalogItem was rolled back.

Specified by:
rolledbackAddCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

canRemoveCatalogItem

public void canRemoveCatalogItem(CatalogChangeEvent<T> e)
                          throws VetoException
Called to ask whether a CatalogItem may be removed. If one of the listeners vetos the removal, all listeners that had already been asked will receive a noRemoveCatalogItem event.

Specified by:
canRemoveCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Throws:
VetoException - if the listener wants to veto the removal.
Override:
Sometimes

noRemoveCatalogItem

public void noRemoveCatalogItem(CatalogChangeEvent<T> e)
Called for each listener that already agreed with a removal that was then rejected by another listener.

Specified by:
noRemoveCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

removedCatalogItem

public void removedCatalogItem(CatalogChangeEvent<T> e)
Called whenever a CatalogItem was removed from the Catalog.

Specified by:
removedCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

commitedRemoveCatalogItem

public void commitedRemoveCatalogItem(CatalogChangeEvent<T> e)
Called whenever the removal of a CatalogItem was commited.

Specified by:
commitedRemoveCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

rolledbackRemoveCatalogItem

public void rolledbackRemoveCatalogItem(CatalogChangeEvent<T> e)
Called whenever the removal of a CatalogItem was rolled back.

Specified by:
rolledbackRemoveCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

canEditCatalogItem

public void canEditCatalogItem(CatalogChangeEvent<T> e)
                        throws VetoException
Called to ask whether a CatalogItem may be edited. If one of the listeners vetos the editing, all steners that had already been asked will receive a noEditCatalogItem event.

Specified by:
canEditCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Throws:
VetoException - if the listener wants to veto the editing.
Override:
Sometimes

noEditCatalogItem

public void noEditCatalogItem(CatalogChangeEvent<T> e)
Called for each listener that already agreed with an editing that was then rejected by another listener.

Specified by:
noEditCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

editingCatalogItem

public void editingCatalogItem(CatalogChangeEvent<T> e)
Called whenever editing a CatalogItem was started. This event may be accompanied by a removedCatalogItem and a addedCatalogItem event, but this is implementation specific.

Specified by:
editingCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

commitEditCatalogItem

public void commitEditCatalogItem(CatalogChangeEvent<T> e)
Called whenever editing a CatalogItem was commited.

Specified by:
commitEditCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

rollbackEditCatalogItem

public void rollbackEditCatalogItem(CatalogChangeEvent<T> e)
Called whenever editing a CatalogItem was rolled back.

Specified by:
rollbackEditCatalogItem in interface CatalogChangeListener<T extends CatalogItem>
Parameters:
e - an event object describing the event.
Override:
Sometimes

SalesPoint v3.3 API