SOURCECODE |
How to... define a FormSheet for a SalesPoint
Description:
The recommended way to define a FormSheet for a SalesPoint is to redefine the method getDefaultFormSheet()
of your Salespoint instance, which is used by the Framework to resolve the FormSheet which shall be displayed at that SalesPoint. You may also add a FormSheet during runtime by using the method setFormSheet(SaleProcess sp, FormSheet fs)
. As you can see, this method is also used to add a SalesProcess to the SalesPoint, which itself is able to display FormSheets, but for further information on that refer to the section "Processes".
This example describes how to add a FormSheet to the SalesPoint, while the FormSheet itself should be assembled in a FormSheetContentCreator. For more information on the FSCC take a close look at "How to create a FormSheet"
ToDo's:
- In the SalesPoint instance (here we use the Counter of the tutorial) redefine the method
getDefaultFormSheet()
- Return the FormSheet you want to be displayed as the SalesPoint's FormSheet
Uses:
SalesPoint FormSheet FormSheetContentCreator
import sale.*;
import sale.stdforms.*;
import log.*;
public class Counter extends SalesPoint {
public Counter(String name) {
super(name);
}
1
public FormSheet getDefaultFormSheet() {
2
return new FormSheet( "Menu", //the Caption
new DefaultCounterFormCreator(), //the FSCC
false); //Shall the Shop be blocked 'till
//the FormSheet is being closed
}
}