/**
  * Fetches all Receipt records
  *
  * @return A List of all of the Receipt records in the Receipt data file; otherwise an empty list
  */
 public List<Receipt> fetchReceipts() {
   FetchDao<Receipt> fetchDao = new FetchDao<Receipt>();
   List<Receipt> receipts = new ArrayList<Receipt>();
   try {
     receipts = fetchDao.fetchAll(FilePaths.RECEIPT_DATA.getPath(), new ConvertFieldsToReceipt());
   } catch (IOException e) {
     ReceiptPrinterLogger.logMessage(
         this.getClass(), Level.SEVERE, "IOException while fetching receipts", e);
   }
   return receipts;
 }
Exemplo n.º 2
0
 /**
  * Expands the AddressTable for printing and then sets it back to a size appropriate for the
  * screen
  */
 public void printAddresses() {
   setTableLook(PRINT_COLUMN_PARAMS, PRINT_FONT, PRINT_HEADER_FONT, printTableCellRenderer);
   try {
     print(PrintMode.FIT_WIDTH, new MessageFormat("Receipt Printer Addresses"), null);
   } catch (PrinterException ex) {
     ReceiptPrinterLogger.logMessage(
         this.getClass(),
         Level.WARNING,
         "PrinterException while attempting to print addresses",
         ex);
   }
   setTableLook(SCREEN_COLUMN_PARAMS, SCREEN_FONT, SCREEN_HEADER_FONT, screenTableCellRenderer);
 }