Package org.jboss.seam.excel

Examples of org.jboss.seam.excel.WorksheetItem


      // Create new worksheet (or select an existing one) and apply settings (if
      // any)
      excelWorkbook.createOrSelectWorksheet(this);

      WorksheetItem headerItem = (WorksheetItem) getFacet(HEADER_FACET_NAME);
      if (headerItem != null)
      {
         int colspan = getChildrenOfType(getChildren(), UIColumn.class).size();
         excelWorkbook.addWorksheetHeader(headerItem, colspan);
      }
View Full Code Here


      if (excelWorkbook == null)
      {
         throw new ExcelWorkbookException("Could not find excel workbook");
      }

      WorksheetItem footerItem = (WorksheetItem) getFacet(FOOTER_FACET_NAME);
      if (footerItem != null)
      {
         int colspan = getChildrenOfType(getChildren(), UIColumn.class).size();
         excelWorkbook.addWorksheetFooter(footerItem, colspan);
      }
View Full Code Here

      {
         throw new ExcelWorkbookException("Could not find worksheet");
      }

      // Add header items (if any)
      WorksheetItem headerItem = (WorksheetItem) getFacet(HEADER_FACET_NAME);
      if (headerItem != null)
      {
         excelWorkbook.addItem(headerItem);
      }

      // Execute commands (if any)
      List<Command> commands = getCommands(getChildren());
      for (Command command : commands)
      {
         excelWorkbook.executeCommand(command);
      }

       // Get UiCell template this column's data cells and iterate over sheet data
      for (WorksheetItem item : getItems(getChildren()))
      {
         Object oldValue = null;
         Iterator iterator = null;
         // Store away the old value for the sheet binding var (if there is one)
         if (sheet.getVar() != null) {
            oldValue = FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get(sheet.getVar());
            iterator = sheet.getDataIterator();
         } else {
            // No var, no iteration...
            iterator = new ArrayList().iterator();
         }
         while (iterator.hasNext())
         {
            // Store the bound data in the request map and add the cell
            FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(sheet.getVar(), iterator.next());
            excelWorkbook.addItem(item);
         }

         //  No iteration, nothing to restore
         if (sheet.getVar() == null) {
            continue;
         }
         // Restore the previously modified request map (if there was a var)
         if (oldValue == null)
         {
            FacesContext.getCurrentInstance().getExternalContext().getRequestMap().remove(sheet.getVar());
         }
         else
         {
            FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(sheet.getVar(), oldValue);
         }
      }

      // Add footer items (if any)
      WorksheetItem footerItem = (WorksheetItem) getFacet(FOOTER_FACET_NAME);
      if (footerItem != null)
      {
         excelWorkbook.addItem(footerItem);
      }
     
View Full Code Here

TOP

Related Classes of org.jboss.seam.excel.WorksheetItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.