SalesPoint Framework v3.1

data.events
Class CatalogChangeAdapter

java.lang.Object
  extended bydata.events.CatalogChangeAdapter
All Implemented Interfaces:
CatalogChangeListener, EventListener, Serializable, SerializableListener

public abstract class CatalogChangeAdapter
extends Object
implements CatalogChangeListener, 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 e)
          Called whenever a CatalogItem was added to the Catalog.
 void canEditCatalogItem(CatalogChangeEvent e)
          Called to ask whether a CatalogItem may be edited.
 void canRemoveCatalogItem(CatalogChangeEvent e)
          Called to ask whether a CatalogItem may be removed.
 void commitedAddCatalogItem(CatalogChangeEvent e)
          Called whenever the adding of a CatalogItem was commited.
 void commitEditCatalogItem(CatalogChangeEvent e)
          Called whenever editing a CatalogItem was commited.
 void commitedRemoveCatalogItem(CatalogChangeEvent e)
          Called whenever the removal of a CatalogItem was commited.
 void editingCatalogItem(CatalogChangeEvent e)
          Called whenever editing a CatalogItem was started.
 void noEditCatalogItem(CatalogChangeEvent e)
          Called for each listener that already agreed with an editing that was then rejected by another listener.
 void noRemoveCatalogItem(CatalogChangeEvent e)
          Called for each listener that already agreed with a removal that was then rejected by another listener.
 void removedCatalogItem(CatalogChangeEvent e)
          Called whenever a CatalogItem was removed from the Catalog.
 void rollbackEditCatalogItem(CatalogChangeEvent e)
          Called whenever editing a CatalogItem was rolled back.
 void rolledbackAddCatalogItem(CatalogChangeEvent e)
          Called whenever the adding of a CatalogItem was rolled back.
 void rolledbackRemoveCatalogItem(CatalogChangeEvent 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 e)
Called whenever a CatalogItem was added to the Catalog.

Specified by:
addedCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

commitedAddCatalogItem

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

Specified by:
commitedAddCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

rolledbackAddCatalogItem

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

Specified by:
rolledbackAddCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

canRemoveCatalogItem

public void canRemoveCatalogItem(CatalogChangeEvent 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
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 e)
Called for each listener that already agreed with a removal that was then rejected by another listener.

Specified by:
noRemoveCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

removedCatalogItem

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

Specified by:
removedCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

commitedRemoveCatalogItem

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

Specified by:
commitedRemoveCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

rolledbackRemoveCatalogItem

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

Specified by:
rolledbackRemoveCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

canEditCatalogItem

public void canEditCatalogItem(CatalogChangeEvent 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
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 e)
Called for each listener that already agreed with an editing that was then rejected by another listener.

Specified by:
noEditCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

editingCatalogItem

public void editingCatalogItem(CatalogChangeEvent 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
Parameters:
e - an event object describing the event.
Override:
Sometimes

commitEditCatalogItem

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

Specified by:
commitEditCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

rollbackEditCatalogItem

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

Specified by:
rollbackEditCatalogItem in interface CatalogChangeListener
Parameters:
e - an event object describing the event.
Override:
Sometimes

SalesPoint Framework v3.1