SOURCECODE |
How to... define the StatusFormSheet for a SalesPoint
Description:
SalesPoints are being displayed in a separate window but also have a StatusDisplay at the Shop, which is the TabbedPane in the Shop's Frame, labled the name of the Salespoint. By bringing it on top, it shows what is defined as the StatusDisplay in your SalesPoint instance and also adds the Menu defined as StatusMenuSheet in the SalesPoint instance to the Shop's MenuSheet. By default, both, the StatusFormSheet and the StatusMenuSheet are empty.
Feel free to use the StatusDisplay and MenuSheet, which are equally handled to the DefaultFormSheet and the DefaultMenuSheet except that due to the strong division of the Shop and it's Salespoints it is not possible to have processes running on it. You may trigger a Processes on it, but they will always be displayed by the SalesPoint's window. Therefor a more suitable name would be "Statical Display". For further information on Processes refer to the section "Processes".
This example describes how to define a FormSheet as the SalesPoint's StatusFormSheet, 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 Couter of the tutorial) redefine the method
getDefaultStatusFormSheet()
- Return the FormSheet you want to be displayed as the StatusFormSheet
Remember, that the Process, triggered on a StatusFormSheet will be displayed in the SalesPoint's window.
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 getDefaultStatusFormSheet() {
2
return new FormSheet( "Menu", //the Caption
new DefaultCounterFormCreator(), //the FSCC
false); //Shall the Shop be blocked 'till
//the FormSheet is being closed
}
}