org.wicketstuff.poi.excel
Class TableComponentAsXlsHandler

java.lang.Object
  extended by org.wicketstuff.poi.excel.TableComponentAsXlsHandler
All Implemented Interfaces:
IRequestHandler

public class TableComponentAsXlsHandler
extends Object
implements IRequestHandler

Request handler that respond the specified table component as a XLS file.

An possible Link onClick method implementation seting this handler could be:

public void onClick() {
IRequestHandler handler = new TableComponentAsXlsHandler( table, "fileName.xls");
RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
}

Author:
Pedro Santos

Constructor Summary
TableComponentAsXlsHandler(Component tableComponent, String filename)
           
 
Method Summary
 void detach(IRequestCycle requestCycle)
           
protected  org.apache.poi.ss.usermodel.Sheet newSheet()
          Create the sheet in where component table data will be set
 void respond(IRequestCycle requestCycle)
           
 void setCellExporter(CellExporter cellExporter)
          Set the exporter strategy to be used by this handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableComponentAsXlsHandler

public TableComponentAsXlsHandler(Component tableComponent,
                                  String filename)
Parameters:
tableComponent -
filename -
Method Detail

respond

public void respond(IRequestCycle requestCycle)
Specified by:
respond in interface IRequestHandler

detach

public void detach(IRequestCycle requestCycle)
Specified by:
detach in interface IRequestHandler

newSheet

protected org.apache.poi.ss.usermodel.Sheet newSheet()
Create the sheet in where component table data will be set

Returns:
a new Sheet to receive the table component data

setCellExporter

public void setCellExporter(CellExporter cellExporter)
Set the exporter strategy to be used by this handler. The default is GeneralPurposeExporter

Parameters:
cellExporter -
See Also:
CellExporter


Copyright © 2013. All Rights Reserved.