SOURCECODE |
How to... react to adding or removing of a SalesPoint
Description:
If a SalesPoint is added or removed from the Shop, a hook method will be called.
If additional action is to be implemented in this case, the protected void onSalesPointAdded(SalesPoint sp)
method or the protected void onSalesPointRemoved(SalesPoint sp)
method will have to be overwritten.
(See also: HowTo..incorporate a Shop )
ToDo's:
- Open Shop where you want to react to adding or removing of a SalesPoint.
- Implement
protected void onSalesPointAdded(SalesPoint sp)
method to react to adding.
Donīt forget to call superclass method, because several other important tasks are handled.
- Implement
protected void onSalesPointRemoved(SalesPoint sp)
method to react to removing.
Donīt forget to call superclass method, because several other important tasks are handled.
Uses:
Shop
1
// Main Class
public class MyShop extends Shop
{
// Constructor
public MyShop()
{
super();
}
2
// hook method called when a salespoint is added
protected void onSalesPointAdded(SalesPoint sp)
{
// donīt forget to call superclass method
super.onSalesPointAdded(sp);
// ...
// add own statements
// ...
}
3
// hook method called when a salespoint is removed
protected void onSalesPointRemoved(SalesPoint sp)
{
// donīt forget to call superclass method
super.onSalesPointRemoved(sp);
// ...
// add own statements
// ...
}
}