001 package market.stdform; 002 003 import javax.swing.JScrollPane; 004 import javax.swing.JTextArea; 005 006 import market.Conversions; 007 import sale.FormSheet; 008 import sale.FormSheetContentCreator; 009 import data.Value; 010 011 /** 012 * This FormSheet displays how much the customer has to pay for his/her current selection. 013 */ 014 public class FSCustomerConfirmSelection extends FormSheet{ 015 016 /** 017 * ID for serialization. 018 */ 019 private static final long serialVersionUID = -1500501222861512478L; 020 021 /** 022 * @param amount the {@link Value} the customer has to pay 023 */ 024 public FSCustomerConfirmSelection(final Value amount){ 025 super("Auswahl bestätigen", null); 026 FormSheetContentCreator fscc = new FormSheetContentCreator(){ 027 private static final long serialVersionUID = -1885726762783615518L; 028 protected void createFormSheetContent(FormSheet fs) { 029 String text = new String("Sie haben Artikel im Wert von: "+ 030 Conversions.valueToCurrency(amount)+" Euro ausgewählt.\n"+ 031 "Mit Kaufen können Sie die Auswahl bestätigen!\n"+ 032 "Mit Zurück können Sie die Auswahl korrigieren!\n"); 033 JTextArea jta = new JTextArea (text); 034 jta.setEditable (false); 035 fs.setComponent (new JScrollPane(jta)); 036 037 fs.removeAllButtons(); 038 fs.addButton("Kaufen",ButtonIDs.BTN_BUY,null); 039 fs.addButton("Zurück",ButtonIDs.BTN_BACK,null); 040 } 041 }; 042 this.addContentCreator(fscc); 043 } 044 }